From 952d39f6c6229d0c2fbf1550cea2180f18612a93 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Tue, 4 Sep 2018 17:51:53 -0700 Subject: [PATCH 1/2] core: normalize URL before checking equality --- lighthouse-core/runner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighthouse-core/runner.js b/lighthouse-core/runner.js index 25facc675598..37b8d7654e8f 100644 --- a/lighthouse-core/runner.js +++ b/lighthouse-core/runner.js @@ -65,7 +65,7 @@ class Runner { if (!requestedUrl) { throw new Error('Cannot run audit mode on empty URL'); } - if (runOpts.url && runOpts.url !== requestedUrl) { + if (runOpts.url && !URL.equalWithExcludedFragments(runOpts.url, requestedUrl)) { throw new Error('Cannot run audit mode on different URL'); } } else { From a15779cebae9aa4db555a70c36ffc8f72e7b9d31 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Tue, 4 Sep 2018 18:42:38 -0700 Subject: [PATCH 2/2] test --- lighthouse-core/test/runner-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighthouse-core/test/runner-test.js b/lighthouse-core/test/runner-test.js index d29195a10144..274a2067ca71 100644 --- a/lighthouse-core/test/runner-test.js +++ b/lighthouse-core/test/runner-test.js @@ -101,7 +101,7 @@ describe('Runner', () => { it('-A throws if the URL changes', async () => { const settings = {auditMode: artifactsPath, disableDeviceEmulation: true}; - const opts = {url: 'https://example.com', config: generateConfig(settings), driverMock}; + const opts = {url: 'https://differenturl.com', config: generateConfig(settings), driverMock}; try { await Runner.run(null, opts); assert.fail('should have thrown');