From 28b299a4a91c1834df26d8d42bdcf439447c7f5c Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Fri, 30 Nov 2018 16:53:51 +0000 Subject: [PATCH] Bug 1508928 [wpt PR 14157] - Add tests for no active script in import(), a=testonly Automatic update from web-platform-testsAdd tests for no active script in import() (#14157) Follows https://github.com/whatwg/html/pull/4181. -- wpt-commits: 5241a3fe2c638f9fadcc040f39f3e6a71a2be2e1 wpt-pr: 14157 --- .../no-active-script-manual-classic.html | 55 +++++++++++++++++++ .../no-active-script-manual-module.html | 55 +++++++++++++++++++ .../scripts/no-active-script.js | 5 ++ 3 files changed, 115 insertions(+) create mode 100644 testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-classic.html create mode 100644 testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-module.html create mode 100644 testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/scripts/no-active-script.js diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-classic.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-classic.html new file mode 100644 index 000000000000..b01f595c03e9 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-classic.html @@ -0,0 +1,55 @@ + + +Dynamic import when there is no active script + + + + +

Click these buttons in sequence:

+ + + + + +

The result will be pass/fail per the testharness.js results

+ + + + + diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-module.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-module.html new file mode 100644 index 000000000000..359b71d821c3 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-module.html @@ -0,0 +1,55 @@ + + +Dynamic import when there is no active script + + + + +

Click these buttons in sequence:

+ + + + + +

The result will be pass/fail per the testharness.js results

+ + + + + diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/scripts/no-active-script.js b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/scripts/no-active-script.js new file mode 100644 index 000000000000..85d8ac29ece8 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/scripts/no-active-script.js @@ -0,0 +1,5 @@ +"use strict"; + +document.querySelector("#button1").setAttribute("onclick", "import('../imports-a.js?label=button1').then(window.continueTest1, window.errorTest1)"); + +document.querySelector("#button2").setAttribute("onclick", "Promise.resolve(`import('../imports-a.js?label=button2')`).then(eval).then(window.continueTest2, window.errorTest2);");