From 680a888a339a0fab7da59aad774e580317a02753 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Thu, 3 Oct 2019 00:17:54 +0000 Subject: [PATCH] Bug 1455907 [wpt PR 8287] - Test active script, via import(), in promise jobs, a=testonly Automatic update from web-platform-testsTest active script, via import(), in promise jobs Follows https://github.com/whatwg/html/pull/3163. -- wpt-commits: 1c3621705bdd047fde1e4a2a165c49ec837ffa1c wpt-pr: 8287 UltraBlame original commit: 89d303876a7e1b2b43d099822477b7f80333b71b --- testing/web-platform/meta/MANIFEST.json | 116 ++++ .../string-compilation-of-promise-result.html | 574 ++++++++++++++++++ 2 files changed, 690 insertions(+) create mode 100644 testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-of-promise-result.html diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 56055febc7fb3..a581bc9294b1f 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -2101890,6 +2101890,80 @@ element / module / +dynamic +- +import +/ +string +- +compilation +- +of +- +promise +- +result +. +html +" +: +[ +[ +" +/ +html +/ +semantics +/ +scripting +- +1 +/ +the +- +script +- +element +/ +module +/ +dynamic +- +import +/ +string +- +compilation +- +of +- +promise +- +result +. +html +" +{ +} +] +] +" +html +/ +semantics +/ +scripting +- +1 +/ +the +- +script +- +element +/ +module +/ error - and @@ -3830231,6 +3830305,48 @@ element / module / +dynamic +- +import +/ +string +- +compilation +- +of +- +promise +- +result +. +html +" +: +[ +" +b579ff5a32f582bc6baf42bfff08d36dafc94c8f +" +" +testharness +" +] +" +html +/ +semantics +/ +scripting +- +1 +/ +the +- +script +- +element +/ +module +/ error - and diff --git a/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-of-promise-result.html b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-of-promise-result.html new file mode 100644 index 0000000000000..1d0c08a9812e6 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-of-promise-result.html @@ -0,0 +1,574 @@ +< +! +DOCTYPE +html +> +< +meta +charset += +" +utf +- +8 +" +> +< +title +> +import +( +) +inside +compiled +strings +inside +a +classic +script +< +/ +title +> +< +link +rel += +" +help +" +href += +" +https +: +/ +/ +github +. +com +/ +whatwg +/ +html +/ +pull +/ +3163 +" +> +< +link +rel += +" +help +" +href += +" +https +: +/ +/ +github +. +com +/ +tc39 +/ +ecma262 +/ +issues +/ +871 +# +issuecomment +- +292493142 +" +> +< +link +rel += +" +author +" +title += +" +Domenic +Denicola +" +href += +" +mailto +: +d +domenic +. +me +" +> +< +script +src += +" +/ +resources +/ +testharness +. +js +" +> +< +/ +script +> +< +script +src += +" +/ +resources +/ +testharnessreport +. +js +" +> +< +/ +script +> +< +script +> +" +use +strict +" +; +self +. +ran += +false +; +promise_test +( +t += +> +{ +t +. +add_cleanup +( +( +) += +> +{ +self +. +ran += +false +; +} +) +return +Promise +. +resolve +( +import +( +" +. +. +/ +imports +- +a +. +js +? +1 +" +) +. +then +( +( +) += +> +{ +self +. +ran += +true +; +} +) +) +. +then +( +eval +) +. +then +( +( +) += +> +{ +assert_true +( +self +. +ran +) +; +} +) +; +} +" +Evaled +the +script +via +eval +successful +import +" +) +; +promise_test +( +t += +> +{ +t +. +add_cleanup +( +( +) += +> +{ +self +. +ran += +false +; +} +) +return +Promise +. +resolve +( +import +( +" +bad +- +specifier +? +1 +" +) +. +catch +( +( +) += +> +{ +self +. +ran += +true +; +} +) +) +. +then +( +eval +) +. +then +( +( +) += +> +{ +assert_true +( +self +. +ran +) +; +} +) +; +} +" +Evaled +the +script +via +eval +failed +import +" +) +; +promise_test +( +t += +> +{ +t +. +add_cleanup +( +( +) += +> +{ +self +. +ran += +false +; +} +) +return +Promise +. +resolve +( +return +import +( +" +. +. +/ +imports +- +a +. +js +? +2 +" +) +. +then +( +( +) += +> +{ +self +. +ran += +true +; +} +) +) +. +then +( +Function +) +. +then +( +Function +. +prototype +. +call +. +bind +( +Function +. +prototype +. +call +) +) +. +then +( +( +) += +> +{ +assert_true +( +self +. +ran +) +; +} +) +; +} +" +Evaled +the +script +via +Function +successful +import +" +) +; +promise_test +( +t += +> +{ +t +. +add_cleanup +( +( +) += +> +{ +self +. +ran += +false +; +} +) +return +Promise +. +resolve +( +return +import +( +" +bad +- +specifier +? +2 +" +) +. +catch +( +( +) += +> +{ +self +. +ran += +true +; +} +) +) +. +then +( +Function +) +. +then +( +Function +. +prototype +. +call +. +bind +( +Function +. +prototype +. +call +) +) +. +then +( +( +) += +> +{ +assert_true +( +self +. +ran +) +; +} +) +; +} +" +Evaled +the +script +via +Function +failed +import +" +) +; +< +/ +script +>