From 3e391e6cbd5a2d9a2c5817ee6dfaf8da2e061c71 Mon Sep 17 00:00:00 2001 From: Ryan Cebulko Date: Fri, 6 Nov 2020 14:36:27 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Unskip=209=20passing=20unit=20tests?= =?UTF-8?q?=20(#31033)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Unskip passing unit tests in test-vsync.js * Unskip passing unit test in test-iframe-helper.js * Unskip passing unit test in test-xhr.js * Unskip passing unit test in test-sanitizer.js * Revert test-inabox-viewport.js --- test/unit/test-iframe-helper.js | 3 +-- test/unit/test-sanitizer.js | 5 +---- test/unit/test-vsync.js | 15 +++++---------- test/unit/test-xhr.js | 2 +- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/test/unit/test-iframe-helper.js b/test/unit/test-iframe-helper.js index 2a4e45b86666..929bca3b83fa 100644 --- a/test/unit/test-iframe-helper.js +++ b/test/unit/test-iframe-helper.js @@ -206,8 +206,7 @@ describe }); }); - // TODO(wg-performance, #25587): Results in a cross-origin frame error. - it.skip('should set sentinel on postMessage data', () => { + it('should set sentinel on postMessage data', () => { insert(testIframe); const postMessageSpy = window.sandbox /*OK*/ .spy(testIframe.contentWindow, 'postMessage'); diff --git a/test/unit/test-sanitizer.js b/test/unit/test-sanitizer.js index 19ddb8e745bb..09aab69d9924 100644 --- a/test/unit/test-sanitizer.js +++ b/test/unit/test-sanitizer.js @@ -331,10 +331,7 @@ function runSanitizerTests() { ); }); - // TODO(choumx): HTTPS-only URI attributes are not enforced consistently - // in the sanitizer yet. E.g. amp-video requires HTTPS, amp-img does not. - // Unskip when this is fixed. - it.skip('should not allow source::src with invalid protocol', () => { + it('should not allow source::src with invalid protocol', () => { expect(sanitize('')).to.equal( '' ); diff --git a/test/unit/test-vsync.js b/test/unit/test-vsync.js index f2f2d1d46154..81b49eb2bedf 100644 --- a/test/unit/test-vsync.js +++ b/test/unit/test-vsync.js @@ -72,8 +72,7 @@ describes.fakeWin('vsync', {}, (env) => { }); }); - // TODO(choumx, #12476): Make this test work with sinon 4.0. - it.skip('should generate a frame and run callbacks', () => { + it('should generate a frame and run callbacks', () => { let result = ''; return new Promise((resolve) => { vsync.run({ @@ -171,8 +170,7 @@ describes.fakeWin('vsync', {}, (env) => { }); }); - // TODO(choumx, #12476): Make this test work with sinon 4.0. - it.skip('should schedule nested vsyncs', () => { + it('should schedule nested vsyncs', () => { let result = ''; return new Promise((resolve) => { vsync.run({ @@ -207,8 +205,7 @@ describes.fakeWin('vsync', {}, (env) => { }); }); - // TODO(choumx, #12476): Make this test work with sinon 4.0. - it.skip('should return a promise from runPromise that executes "run"', () => { + it('should return a promise from runPromise that executes "run"', () => { const measureSpy = env.sandbox.spy(); const mutateSpy = env.sandbox.spy(); return vsync @@ -219,8 +216,7 @@ describes.fakeWin('vsync', {}, (env) => { }); }); - // TODO(choumx, #12476): Make this test work with sinon 4.0. - it.skip('should return a promise from measurePromise that runs measurer', () => { + it('should return a promise from measurePromise that runs measurer', () => { let measured = false; return vsync .measurePromise(() => { @@ -231,8 +227,7 @@ describes.fakeWin('vsync', {}, (env) => { }); }); - // TODO(choumx, #12476): Make this test work with sinon 4.0. - it.skip('should return a promise from mutatePromisethat runs mutator', () => { + it('should return a promise from mutatePromisethat runs mutator', () => { const mutator = env.sandbox.spy(); return vsync.mutatePromise(mutator).then(() => { expect(mutator).to.be.calledOnce; diff --git a/test/unit/test-xhr.js b/test/unit/test-xhr.js index dde773da47a2..9da811ff2a35 100644 --- a/test/unit/test-xhr.js +++ b/test/unit/test-xhr.js @@ -370,7 +370,7 @@ describe }); }); - it.skip('should do simple JSON fetch', () => { + it('should do simple JSON fetch', () => { window.sandbox.stub(user(), 'assert'); return xhr .fetchJson(`${baseUrl}/get?k=v1`)