From 1a20b2ab0234f3c6b4eb7b78edbdfe4da3364934 Mon Sep 17 00:00:00 2001 From: powerivq Date: Tue, 11 Feb 2020 17:55:04 -0800 Subject: [PATCH] Another set of example.com change --- ads/google/a4a/test/test-utils.js | 2 +- build-system/server/amp4test.js | 2 +- build-system/server/app.js | 2 +- .../0.1/test/test-amp-ad-network-fake-impl.js | 2 +- .../test-external-reorder-head-transformer.js | 2 +- .../test-iframe-transport-message-queue.js | 2 +- .../0.1/test/test-iframe-transport.js | 12 +-- .../0.1/test/test-linker-reader.js | 28 +++---- .../amp-analytics/0.1/test/test-linker.js | 4 +- .../0.1/test/test-resource-timing.js | 82 +++++++++---------- .../amp-analytics/0.1/test/test-transport.js | 42 +++++----- .../amp-analytics/0.1/test/test-variables.js | 6 +- .../0.1/test/test-visibility-manager.js | 2 +- .../0.1/test/test-consent-config.js | 22 ++--- test/unit/test-extension-analytics.js | 8 +- test/unit/test-friendly-iframe-embed.js | 2 +- 16 files changed, 110 insertions(+), 110 deletions(-) diff --git a/ads/google/a4a/test/test-utils.js b/ads/google/a4a/test/test-utils.js index 091d4c5ea00e6..76bde3c5535fe 100644 --- a/ads/google/a4a/test/test-utils.js +++ b/ads/google/a4a/test/test-utils.js @@ -300,7 +300,7 @@ describe('Google A4A utils', () => { expect( getAmpRuntimeTypeParameter({ AMP_CONFIG: {type: 'experimental'}, - location: {origin: 'https://www.example.com'}, + location: {origin: 'https://www.example.test'}, }) ).to.be.null; }); diff --git a/build-system/server/amp4test.js b/build-system/server/amp4test.js index 26b880043ce88..227932359e031 100644 --- a/build-system/server/amp4test.js +++ b/build-system/server/amp4test.js @@ -189,7 +189,7 @@ app.get('/a4a/:bid', (req, res) => { cors.enableCors(req, res); const {bid} = req.params; const body = ` - + diff --git a/build-system/server/app.js b/build-system/server/app.js index 99f228f0cc5f8..47763ce8cc4e6 100644 --- a/build-system/server/app.js +++ b/build-system/server/app.js @@ -684,7 +684,7 @@ function getLiveBlogItem() {
diff --git a/extensions/amp-ad-network-fake-impl/0.1/test/test-amp-ad-network-fake-impl.js b/extensions/amp-ad-network-fake-impl/0.1/test/test-amp-ad-network-fake-impl.js index 5147114c30dc7..07f26d6a4de24 100644 --- a/extensions/amp-ad-network-fake-impl/0.1/test/test-amp-ad-network-fake-impl.js +++ b/extensions/amp-ad-network-fake-impl/0.1/test/test-amp-ad-network-fake-impl.js @@ -37,7 +37,7 @@ describes.realWin( const metaCharset = ``; const metaViewport = ``; const ampCustomStyle = ``; - const linkIcon = ``; + const linkIcon = ``; let doc; let win; let fakeImplElem; diff --git a/extensions/amp-ad-network-fake-impl/0.1/test/test-external-reorder-head-transformer.js b/extensions/amp-ad-network-fake-impl/0.1/test/test-external-reorder-head-transformer.js index 77671f37d3f70..be37b8cb21d48 100644 --- a/extensions/amp-ad-network-fake-impl/0.1/test/test-external-reorder-head-transformer.js +++ b/extensions/amp-ad-network-fake-impl/0.1/test/test-external-reorder-head-transformer.js @@ -30,7 +30,7 @@ const crossorigin = ``; const ampCustomStyle = ``; -const linkIcon = ``; +const linkIcon = ``; const ampViewerIntegration = ``; const ampGmail = ``; diff --git a/extensions/amp-analytics/0.1/test/test-iframe-transport-message-queue.js b/extensions/amp-analytics/0.1/test/test-iframe-transport-message-queue.js index 6a169e15829ab..d28361c6f6057 100644 --- a/extensions/amp-analytics/0.1/test/test-iframe-transport-message-queue.js +++ b/extensions/amp-analytics/0.1/test/test-iframe-transport-message-queue.js @@ -29,7 +29,7 @@ describes.realWin( 'sandbox': 'allow-scripts', 'name': 'some_name', }); - frame.src = 'http://example.com'; + frame.src = 'http://example.test'; frame.sentinel = '42'; queue = new IframeTransportMessageQueue(env.win, frame); }); diff --git a/extensions/amp-analytics/0.1/test/test-iframe-transport.js b/extensions/amp-analytics/0.1/test/test-iframe-transport.js index 14ec432638e23..c8ef17896b5e1 100644 --- a/extensions/amp-analytics/0.1/test/test-iframe-transport.js +++ b/extensions/amp-analytics/0.1/test/test-iframe-transport.js @@ -25,7 +25,7 @@ import {user} from '../../../../src/log'; describes.realWin('amp-analytics.iframe-transport', {amp: true}, env => { let iframeTransport; - const frameUrl = 'http://example.com'; + const frameUrl = 'http://example.test'; beforeEach(() => { iframeTransport = new IframeTransport( @@ -61,7 +61,7 @@ describes.realWin('amp-analytics.iframe-transport', {amp: true}, env => { }); it('enqueues event messages correctly', () => { - const url = 'https://example.com/test'; + const url = 'https://example.test/test'; const config = {iframe: url}; iframeTransport.sendRequest('hello, world!', config); const {queue} = IframeTransport.getFrameData(iframeTransport.getType()); @@ -74,8 +74,8 @@ describes.realWin('amp-analytics.iframe-transport', {amp: true}, env => { const iframeTransport2 = new IframeTransport( env.ampdoc.win, 'some_other_vendor_type', - {iframe: 'https://example.com/test2'}, - 'https://example.com/test2-2' + {iframe: 'https://example.test/test2'}, + 'https://example.test/test2-2' ); const frame1 = IframeTransport.getFrameData(iframeTransport.getType()); @@ -89,7 +89,7 @@ describes.realWin('amp-analytics.iframe-transport', {amp: true}, env => { }); it('correctly tracks usageCount and destroys iframes', () => { - const frameUrl2 = 'https://example.com/test2'; + const frameUrl2 = 'https://example.test/test2'; const iframeTransport2 = new IframeTransport( env.ampdoc.win, 'some_other_vendor_type', @@ -161,7 +161,7 @@ describes.realWin('amp-analytics.iframe-transport', {amp: true}, env => { expect(createPerformanceObserverSpy).to.not.be.called; // Create frame for a new vendor - const frameUrl2 = 'https://example.com/test2'; + const frameUrl2 = 'https://example.test/test2'; new IframeTransport( env.ampdoc.win, 'some_other_vendor_type', diff --git a/extensions/amp-analytics/0.1/test/test-linker-reader.js b/extensions/amp-analytics/0.1/test/test-linker-reader.js index 5a08a7cdbb5a8..5eb1a8a9602e7 100644 --- a/extensions/amp-analytics/0.1/test/test-linker-reader.js +++ b/extensions/amp-analytics/0.1/test/test-linker-reader.js @@ -37,7 +37,7 @@ describe('LinkerReader', () => { ); mockWin.getUserLanguage.returns('en-US'); mockWin.location = { - href: 'https://example.com?testlinker=1*1f66u1p*key1*dmFsdWUx', + href: 'https://example.test?testlinker=1*1f66u1p*key1*dmFsdWUx', }; mockWin.history = { replaceState: (unusedVar1, unusedVar2, newHref) => { @@ -53,63 +53,63 @@ describe('LinkerReader', () => { expectAsyncConsoleError(/LINKER_PARAM requires two params, name and id/); expect(linkerReader.get('testlinker')).to.be.null; expect(mockWin.location.href).to.equal( - 'https://example.com?testlinker=1*1f66u1p*key1*dmFsdWUx' + 'https://example.test?testlinker=1*1f66u1p*key1*dmFsdWUx' ); }); it('return null when no linker name', () => { expect(linkerReader.get('nolinker', 'id')).to.be.null; expect(mockWin.location.href).to.equal( - 'https://example.com?testlinker=1*1f66u1p*key1*dmFsdWUx' + 'https://example.test?testlinker=1*1f66u1p*key1*dmFsdWUx' ); }); it('return null when linker name value is invalid', () => { expectAsyncConsoleError(/LINKER_PARAM value checksum not valid/); - mockWin.location.href = 'https://example.com?testlinker=1*123*key*error'; + mockWin.location.href = 'https://example.test?testlinker=1*123*key*error'; expect(linkerReader.get('testlinker', 'key')).to.be.null; - expect(mockWin.location.href).to.equal('https://example.com/'); + expect(mockWin.location.href).to.equal('https://example.test/'); }); it('return null when no linker id value', () => { mockWin.location.href = - 'https://example.com?testlinker=1*1f66u1p*key1*dmFsdWUx'; + 'https://example.test?testlinker=1*1f66u1p*key1*dmFsdWUx'; expect(linkerReader.get('testlinker', 'key2')).to.be.null; - expect(mockWin.location.href).to.equal('https://example.com/'); + expect(mockWin.location.href).to.equal('https://example.test/'); }); it('remove linker_param from url', () => { mockWin.location.href = - 'https://example.com?a=1&b=2&' + + 'https://example.test?a=1&b=2&' + 'testlinker=1*1f66u1p*key1*dmFsdWUx&c&' + 'testlinker2=1*1f66u1p*key1*dmFsdWUx&d=2#hash'; linkerReader.get('testlinker', 'id'); expect(mockWin.location.href).to.equal( - 'https://example.com/?a=1&b=2&c&' + + 'https://example.test/?a=1&b=2&c&' + 'testlinker2=1*1f66u1p*key1*dmFsdWUx&d=2#hash' ); linkerReader.get('testlinker2', 'key1'); expect(mockWin.location.href).to.equal( - 'https://example.com/?a=1&b=2&c&d=2#hash' + 'https://example.test/?a=1&b=2&c&d=2#hash' ); }); it('return correct id value', () => { mockWin.location.href = - 'https://example.com?' + + 'https://example.test?' + 'test=1*1f66u1p*key1*dmFsdWUx&var=foo&' + 'test2=1*1m48hbv*cid*MTIzNDU.*ref*aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20.'; expect(linkerReader.get('test', 'key1')).to.equal('value1'); expect(linkerReader.get('test2', 'cid')).to.equal('12345'); expect(linkerReader.get('test2', 'ref')).to.equal( - 'https://www.example.com' + 'https://www.example.test' ); - expect(mockWin.location.href).to.equal('https://example.com/?var=foo'); + expect(mockWin.location.href).to.equal('https://example.test/?var=foo'); }); it('returns same value when reading the same id', () => { mockWin.location.href = - 'https://example.com?test=1*1f66u1p*key1*dmFsdWUx&var=foo'; + 'https://example.test?test=1*1f66u1p*key1*dmFsdWUx&var=foo'; expect(linkerReader.get('test', 'key1')).to.equal('value1'); expect(linkerReader.get('test', 'key1')).to.equal('value1'); }); diff --git a/extensions/amp-analytics/0.1/test/test-linker.js b/extensions/amp-analytics/0.1/test/test-linker.js index 038fdce8a5bd0..6b1f78f309d48 100644 --- a/extensions/amp-analytics/0.1/test/test-linker.js +++ b/extensions/amp-analytics/0.1/test/test-linker.js @@ -76,7 +76,7 @@ const parseLinkerTests = [ value: '1*1m48hbv*cid*MTIzNDU.*ref*aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20.', output: { cid: '12345', - ref: 'https://www.example.com', + ref: 'https://www.example.test', }, }, { @@ -158,7 +158,7 @@ const createLinkerTests = [ version: '1', pairs: { cid: '12345', - ref: 'https://www.example.com', + ref: 'https://www.example.test', }, output: '1*1m48hbv*cid*MTIzNDU.*ref*aHR0cHM6Ly93d3cuZXhhbXBsZS5jb20.', }, diff --git a/extensions/amp-analytics/0.1/test/test-resource-timing.js b/extensions/amp-analytics/0.1/test/test-resource-timing.js index dd62c50d6cee6..9aeb1e30693c7 100644 --- a/extensions/amp-analytics/0.1/test/test-resource-timing.js +++ b/extensions/amp-analytics/0.1/test/test-resource-timing.js @@ -26,11 +26,11 @@ export function newResourceTimingSpec() { return { 'resources': { 'foo_bar': { - 'host': '(foo|bar).example.com', + 'host': '(foo|bar).example.test', 'path': '/lib.js', }, 'foo_style': { - 'host': 'example.com', + 'host': 'example.test', 'path': '.*.css', }, }, @@ -139,7 +139,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should return empty when start time has passed 1s', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js?v=123', + 'http://foo.example.test/lib.js?v=123', 'script', 100, 500, @@ -157,7 +157,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should return empty if resourceTimingSpec is empty', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js?v=123', + 'http://foo.example.test/lib.js?v=123', 'script', 100, 500, @@ -169,7 +169,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should return empty if encoding spec is empty', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js?v=123', + 'http://foo.example.test/lib.js?v=123', 'script', 100, 500, @@ -183,7 +183,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should return empty if encoding spec is missing delim', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js?v=123', + 'http://foo.example.test/lib.js?v=123', 'script', 100, 500, @@ -197,7 +197,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should return empty if encoding spec is missing entry', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js?v=123', + 'http://foo.example.test/lib.js?v=123', 'script', 100, 500, @@ -211,7 +211,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should serialize matching entries', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js?v=123', + 'http://foo.example.test/lib.js?v=123', 'script', 100, 500, @@ -225,7 +225,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should serialize multiple matching entries', () => { const entry1 = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js?v=123', + 'http://foo.example.test/lib.js?v=123', 'script', 100, 500, @@ -233,7 +233,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { false ); const entry2 = newPerformanceResourceTiming( - 'http://bar.example.com/lib.js', + 'http://bar.example.test/lib.js', 'script', 700, 100, @@ -249,7 +249,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should match against the first spec', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js?v=123', + 'http://foo.example.test/lib.js?v=123', 'script', 100, 500, @@ -261,7 +261,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { // Note that both spec'd resources match. spec.resources = { 'foo_bar': { - 'host': '(foo|bar).example.com', + 'host': '(foo|bar).example.test', 'path': '/lib.js', }, 'any': {}, @@ -272,7 +272,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should accept empty per-resource specs', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js?v=123', + 'http://foo.example.test/lib.js?v=123', 'script', 100, 500, @@ -285,7 +285,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { spec.resources = { 'any': {}, 'foo_bar': { - 'host': '(foo|bar).example.com', + 'host': '(foo|bar).example.test', 'path': '/lib.js', }, }; @@ -295,7 +295,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should should only report resources if the host matches', () => { const entry1 = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js', + 'http://foo.example.test/lib.js', 'script', 100, 500, @@ -303,7 +303,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { false ); const entry2 = newPerformanceResourceTiming( - 'http://baz.example.com/lib.js', + 'http://baz.example.test/lib.js', 'script', 700, 100, @@ -312,13 +312,13 @@ describes.realWin('resourceTiming', {amp: true}, env => { ); const spec = newResourceTimingSpec(); - spec.resources = {'foo': {'host': 'foo.example.com'}}; + spec.resources = {'foo': {'host': 'foo.example.test'}}; return runSerializeTest([entry1, entry2], spec, 'foo-script-100-500-7200'); }); it('should should only report resources if the path matches', () => { const entry1 = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js', + 'http://foo.example.test/lib.js', 'script', 100, 500, @@ -326,7 +326,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { false ); const entry2 = newPerformanceResourceTiming( - 'http://foo.example.com/extra.js', + 'http://foo.example.test/extra.js', 'script', 700, 100, @@ -336,14 +336,14 @@ describes.realWin('resourceTiming', {amp: true}, env => { const spec = newResourceTimingSpec(); spec.resources = { - 'foo': {'host': 'foo.example.com', 'path': 'lib.js'}, + 'foo': {'host': 'foo.example.test', 'path': 'lib.js'}, }; return runSerializeTest([entry1, entry2], spec, 'foo-script-100-500-7200'); }); it('should should only report resources if the query matches', () => { const entry1 = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js?v=200', + 'http://foo.example.test/lib.js?v=200', 'script', 100, 500, @@ -351,7 +351,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { false ); const entry2 = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js?v=test', + 'http://foo.example.test/lib.js?v=test', 'script', 700, 100, @@ -362,7 +362,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { const spec = newResourceTimingSpec(); spec.resources = { 'foo': { - 'host': 'foo.example.com', + 'host': 'foo.example.test', 'path': 'lib.js', 'query': '^\\?v=\\d+', }, @@ -372,7 +372,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should replace ${key} and ${initiatorType}', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/style.css?v=200', + 'http://foo.example.test/style.css?v=200', 'link', 100, 500, @@ -386,7 +386,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should replace ${startTime} and ${duration}', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/style.css?v=200', + 'http://foo.example.test/style.css?v=200', 'link', 100, 500, @@ -400,7 +400,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should replace ${domainLookupTime} and ${tcpConnectTime}', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/style.css?v=200', + 'http://foo.example.test/style.css?v=200', 'link', 100, 500, @@ -414,7 +414,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should replace ${serverResponseTime} and ${networkTransferTime}', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/style.css?v=200', + 'http://foo.example.test/style.css?v=200', 'link', 100, 500, @@ -428,7 +428,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should replace ${transferSize}, ${encodedBodySize}, ${decodedBodySize}', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/style.css?v=200', + 'http://foo.example.test/style.css?v=200', 'link', 100, 500, @@ -443,7 +443,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should use the base specified in encoding', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/style.css?v=200', + 'http://foo.example.test/style.css?v=200', 'link', 100, 500, @@ -459,7 +459,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should reject invalid bases (over 36)', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/style.css?v=200', + 'http://foo.example.test/style.css?v=200', 'link', 100, 500, @@ -476,7 +476,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should not replace other analytics variables', () => { const entry1 = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js?v=123', + 'http://foo.example.test/lib.js?v=123', 'script', 100, 500, @@ -484,7 +484,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { false ); const entry2 = newPerformanceResourceTiming( - 'http://bar.example.com/lib.js', + 'http://bar.example.test/lib.js', 'script', 700, 100, @@ -499,7 +499,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should URL-encode the results', () => { const entry1 = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js?v=123', + 'http://foo.example.test/lib.js?v=123', 'script', 100, 500, @@ -507,7 +507,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { false ); const entry2 = newPerformanceResourceTiming( - 'http://bar.example.com/lib.js', + 'http://bar.example.test/lib.js', 'script', 700, 100, @@ -526,7 +526,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should only include resources downloaded after `responseAfter`', () => { const entry1 = newPerformanceResourceTiming( - 'http://foo.example.com/lib.js?v=123', + 'http://foo.example.test/lib.js?v=123', 'script', 100, 200, @@ -534,7 +534,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { false ); const entry2 = newPerformanceResourceTiming( - 'http://bar.example.com/lib.js', + 'http://bar.example.test/lib.js', 'script', 200, 200, @@ -542,7 +542,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { true ); const entry3 = newPerformanceResourceTiming( - 'http://bar.example.com/lib.js', + 'http://bar.example.test/lib.js', 'script', 300, 200, @@ -562,7 +562,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should reject invalid (non-numeric) responseAfter fields', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/style.css?v=200', + 'http://foo.example.test/style.css?v=200', 'link', 100, 500, @@ -578,7 +578,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should update responseAfter', () => { const initialEntry = newPerformanceResourceTiming( - 'https://example.com/lib.css', + 'https://example.test/lib.css', 'link', 100, 400, @@ -586,7 +586,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { false ); const laterEntry = newPerformanceResourceTiming( - 'https://bar.example.com/lib.js', + 'https://bar.example.test/lib.js', 'script', 200, 500, @@ -656,7 +656,7 @@ describes.realWin('resourceTiming', {amp: true}, env => { it('should not report if resourceTimingSpec is done', () => { const entry = newPerformanceResourceTiming( - 'http://foo.example.com/style.css?v=200', + 'http://foo.example.test/style.css?v=200', 'link', 100, 500, diff --git a/extensions/amp-analytics/0.1/test/test-transport.js b/extensions/amp-analytics/0.1/test/test-transport.js index c4a5bab7c65c5..bc2c1a559a5ec 100644 --- a/extensions/amp-analytics/0.1/test/test-transport.js +++ b/extensions/amp-analytics/0.1/test/test-transport.js @@ -52,53 +52,53 @@ describes.realWin( it('prefers beacon over xhrpost and image', () => { setupStubs(true, true); - sendRequest(win, 'https://example.com/test', { + sendRequest(win, 'https://example.test/test', { beacon: true, xhrpost: true, image: true, }); - expectBeacon('https://example.com/test', ''); + expectBeacon('https://example.test/test', ''); expectNoXhr(); expectNoImagePixel(); }); it('prefers xhrpost over image', () => { setupStubs(true, true); - sendRequest(win, 'https://example.com/test', { + sendRequest(win, 'https://example.test/test', { beacon: false, xhrpost: true, image: true, }); expectNoBeacon(); - expectXhr('https://example.com/test', ''); + expectXhr('https://example.test/test', ''); expectNoImagePixel(); }); it('reluctantly uses image if nothing else is enabled', () => { setupStubs(true, true); - sendRequest(win, 'https://example.com/test', { + sendRequest(win, 'https://example.test/test', { image: true, }); expectNoBeacon(); - expectImagePixel('https://example.com/test'); + expectImagePixel('https://example.test/test'); expectNoXhr(); }); it('falls back to image setting suppressWarnings to true', () => { setupStubs(true, true); - sendRequest(win, 'https://example.com/test', { + sendRequest(win, 'https://example.test/test', { beacon: false, xhrpost: false, image: {suppressWarnings: true}, }); expectNoBeacon(); expectNoXhr(); - expectImagePixel('https://example.com/test'); + expectImagePixel('https://example.test/test'); }); it('falls back to image setting referrerPolicy', () => { setupStubs(true, true); - sendRequest(win, 'https://example.com/test', { + sendRequest(win, 'https://example.test/test', { beacon: true, xhrpost: true, image: true, @@ -106,48 +106,48 @@ describes.realWin( }); expectNoBeacon(); expectNoXhr(); - expectImagePixel('https://example.com/test', 'no-referrer'); + expectImagePixel('https://example.test/test', 'no-referrer'); }); it('falls back to xhrpost when enabled and beacon is not available', () => { setupStubs(false, true); - sendRequest(win, 'https://example.com/test', { + sendRequest(win, 'https://example.test/test', { beacon: true, xhrpost: true, image: true, }); expectNoBeacon(); - expectXhr('https://example.com/test', ''); + expectXhr('https://example.test/test', ''); expectNoImagePixel(); }); it('falls back to image when beacon not found and xhr disabled', () => { setupStubs(false, true); - sendRequest(win, 'https://example.com/test', { + sendRequest(win, 'https://example.test/test', { beacon: true, xhrpost: false, image: true, }); expectNoBeacon(); expectNoXhr(); - expectImagePixel('https://example.com/test'); + expectImagePixel('https://example.test/test'); }); it('falls back to image when beacon and xhr are not available', () => { setupStubs(false, false); - sendRequest(win, 'https://example.com/test', { + sendRequest(win, 'https://example.test/test', { beacon: true, xhrpost: true, image: true, }); expectNoBeacon(); expectNoXhr(); - expectImagePixel('https://example.com/test'); + expectImagePixel('https://example.test/test'); }); it('does not send a request when no transport methods are enabled', () => { setupStubs(true, true); - sendRequest(win, 'https://example.com/test', {}); + sendRequest(win, 'https://example.test/test', {}); expectNoBeacon(); expectNoXhr(); expectNoImagePixel(); @@ -318,7 +318,7 @@ describes.realWin( it('asserts that urls are https', () => { allowConsoleError(() => { expect(() => { - sendRequest(win, 'http://example.com/test', {image: true}); + sendRequest(win, 'http://example.test/test', {image: true}); }).to.throw(/https/); }); }); @@ -361,7 +361,7 @@ describes.realWin( it('iframe asserts that urls are https', () => { allowConsoleError(() => { expect(() => { - sendRequestUsingIframe(win, 'http://example.com/test'); + sendRequestUsingIframe(win, 'http://example.test/test'); }).to.throw(/https/); }); }); @@ -369,12 +369,12 @@ describes.realWin( it('forbids same origin', () => { const fakeWin = { location: { - href: 'https://example.com/abc', + href: 'https://example.test/abc', }, }; allowConsoleError(() => { expect(() => { - sendRequestUsingIframe(fakeWin, 'https://example.com/123'); + sendRequestUsingIframe(fakeWin, 'https://example.test/123'); }).to.throw(/Origin of iframe request/); }); }); diff --git a/extensions/amp-analytics/0.1/test/test-variables.js b/extensions/amp-analytics/0.1/test/test-variables.js index ecaaea696cd26..9ab8a088a320d 100644 --- a/extensions/amp-analytics/0.1/test/test-variables.js +++ b/extensions/amp-analytics/0.1/test/test-variables.js @@ -281,7 +281,7 @@ describes.fakeWin('amp-analytics.VariableService', {amp: true}, env => { it('handles consecutive macros in inner arguments', () => { env.sandbox.useFakeTimers(123456789); - win.location.href = 'https://example.com/?test=yes'; + win.location.href = 'https://example.test/?test=yes'; return check( '$IF(QUERY_PARAM(test), 1.$SUBSTR(TIMESTAMP, 0, 10)QUERY_PARAM(test), ``)', '1.123456789yes' @@ -290,7 +290,7 @@ describes.fakeWin('amp-analytics.VariableService', {amp: true}, env => { it('handles consecutive macros w/o parens in inner arguments', () => { env.sandbox.useFakeTimers(123456789); - win.location.href = 'https://example.com/?test=yes'; + win.location.href = 'https://example.test/?test=yes'; return check('$IF(QUERY_PARAM(test), 1.TIMESTAMP, ``)', '1.123456789'); }); @@ -301,7 +301,7 @@ describes.fakeWin('amp-analytics.VariableService', {amp: true}, env => { it('should not trim right of string before macro', () => { env.sandbox.useFakeTimers(123456789); - win.location.href = 'https://example.com/?test=yes'; + win.location.href = 'https://example.test/?test=yes'; return check( '$IF(QUERY_PARAM(test), foo TIMESTAMP, ``)', 'foo%20123456789' diff --git a/extensions/amp-analytics/0.1/test/test-visibility-manager.js b/extensions/amp-analytics/0.1/test/test-visibility-manager.js index ff46412ab9aca..2464530169c51 100644 --- a/extensions/amp-analytics/0.1/test/test-visibility-manager.js +++ b/extensions/amp-analytics/0.1/test/test-visibility-manager.js @@ -1699,7 +1699,7 @@ describes.realWin( top.document.body.appendChild(host); shadowRoot = host.attachShadow({mode: 'open'}); shadowDoc = ampdocService.installShadowDoc( - 'https://example.com', + 'https://example.test', shadowRoot ); env.sandbox.stub(Services, 'resourcesForDoc').returns({}); diff --git a/extensions/amp-consent/0.1/test/test-consent-config.js b/extensions/amp-consent/0.1/test/test-consent-config.js index cd8adfe9ecd90..03225bdda47b2 100644 --- a/extensions/amp-consent/0.1/test/test-consent-config.js +++ b/extensions/amp-consent/0.1/test/test-consent-config.js @@ -237,16 +237,16 @@ describes.realWin('ConsentConfig', {amp: 1}, env => { 'consentRequired': true, }, 'waldo': { - 'checkConsentHref': 'https://example.com/check-consent', + 'checkConsentHref': 'https://example.test/check-consent', 'consentRequired': 'remote', }, 'geoGroupUnknown': { - 'checkConsentHref': 'https://example.com/check-consent', + 'checkConsentHref': 'https://example.test/check-consent', 'consentRequired': true, }, 'invalid': { 'consentInstanceId': 'error', - 'checkConsentHref': 'https://example.com/check-consent', + 'checkConsentHref': 'https://example.test/check-consent', }, }, }; @@ -309,7 +309,7 @@ describes.realWin('ConsentConfig', {amp: 1}, env => { const consentConfig = new ConsentConfig(element); expect(await consentConfig.getConsentConfigPromise()).to.deep.equal({ 'consentInstanceId': 'abc', - 'checkConsentHref': 'https://example.com/check-consent', + 'checkConsentHref': 'https://example.test/check-consent', 'consentRequired': 'remote', }); }); @@ -319,7 +319,7 @@ describes.realWin('ConsentConfig', {amp: 1}, env => { 'consentInstanceId': 'abc', 'geoOverride': { 'geoGroupUnknown': { - 'checkConsentHref': 'https://example.com/check-consent', + 'checkConsentHref': 'https://example.test/check-consent', 'consentRequired': true, }, }, @@ -339,7 +339,7 @@ describes.realWin('ConsentConfig', {amp: 1}, env => { const consentConfig = new ConsentConfig(element); expect(await consentConfig.getConsentConfigPromise()).to.deep.equal({ 'consentInstanceId': 'abc', - 'checkConsentHref': 'https://example.com/check-consent', + 'checkConsentHref': 'https://example.test/check-consent', 'consentRequired': true, }); }); @@ -347,13 +347,13 @@ describes.realWin('ConsentConfig', {amp: 1}, env => { it('should have remote consentRequired if checkConsentHref', async () => { geoConfig = { 'consentInstanceId': 'abc', - 'checkConsentHref': 'https://example.com/check-consent', + 'checkConsentHref': 'https://example.test/check-consent', }; appendConfigScriptElement(doc, element, geoConfig); const consentConfig = new ConsentConfig(element); expect(await consentConfig.getConsentConfigPromise()).to.deep.equal({ 'consentInstanceId': 'abc', - 'checkConsentHref': 'https://example.com/check-consent', + 'checkConsentHref': 'https://example.test/check-consent', 'consentRequired': 'remote', }); }); @@ -399,7 +399,7 @@ describes.realWin('ConsentConfig', {amp: 1}, env => { expect(await consentConfig.getConsentConfigPromise()).to.deep.equal({ 'consentInstanceId': 'abc', 'consentRequired': false, - 'checkConsentHref': 'https://example.com/check-consent', + 'checkConsentHref': 'https://example.test/check-consent', }); }); }); @@ -501,7 +501,7 @@ describes.realWin('ConsentConfig', {amp: 1}, env => { element, dict({ 'consentInstanceId': 'ABC', - 'checkConsentHref': 'example.com/', + 'checkConsentHref': 'example.test/', 'policy': { 'ABC': undefined, }, @@ -510,7 +510,7 @@ describes.realWin('ConsentConfig', {amp: 1}, env => { const consentConfig = new ConsentConfig(element); expect(await consentConfig.getConsentConfigPromise()).to.deep.equal({ 'consentInstanceId': 'ABC', - 'checkConsentHref': 'example.com/', + 'checkConsentHref': 'example.test/', 'consentRequired': 'remote', 'policy': {}, }); diff --git a/test/unit/test-extension-analytics.js b/test/unit/test-extension-analytics.js index dfc6280862a9a..7219c8d57b4bc 100644 --- a/test/unit/test-extension-analytics.js +++ b/test/unit/test-extension-analytics.js @@ -55,7 +55,7 @@ describes.realWin( () => { const config = { 'requests': { - 'pageview': 'https://example.com/analytics', + 'pageview': 'https://example.test/analytics', }, 'triggers': { 'trackPageview': { @@ -164,7 +164,7 @@ describes.realWin( it('should not add already tracked event', () => { try { - builder.track('test', 'fake.com').track('test', 'example.com'); + builder.track('test', 'fake.com').track('test', 'example.test'); } catch (e) { expect(e.message).to.equal( 'customEventReporterBuilder should not track same eventType twice' @@ -315,7 +315,7 @@ describes.realWin( let resolver; const config = { 'requests': { - 'pageview': 'https://example.com/analytics', + 'pageview': 'https://example.test/analytics', }, 'triggers': { 'trackPageview': { @@ -326,7 +326,7 @@ describes.realWin( }; const config2 = { 'requests': { - 'pageview': 'https://example.com/analytics2', + 'pageview': 'https://example.test/analytics2', }, 'triggers': { 'trackPageview': { diff --git a/test/unit/test-friendly-iframe-embed.js b/test/unit/test-friendly-iframe-embed.js index edd6bd8fbcd69..8a8af28291e60 100644 --- a/test/unit/test-friendly-iframe-embed.js +++ b/test/unit/test-friendly-iframe-embed.js @@ -1362,7 +1362,7 @@ describes.realWin('installExtensionsInFie', {amp: true}, env => { iframeDocEl = iframeWin.document.documentElement; setParentWindow(iframeWin, parentWin); ampdoc = ampdocService.installFieDoc( - 'https://example.com/embed', + 'https://example.test/embed', iframeWin ); });