Index: third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/test1.html |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/test1.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/test1.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2bc9cc71c74fd35420e1b9f5bb24c3985b2438ab |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/test1.html |
@@ -0,0 +1,42 @@ |
+ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+ <title>html-script-module-evaluation-error-1</title> |
+ <script src="/resources/testharness.js"></script> |
+ <script src="/resources/testharnessreport.js"></script> |
+</head> |
+<body> |
+ <h1>html-script-module-evaluation-error-1</h1> |
+ <script> |
+ |
+ var log = []; |
+ setup({allow_uncaught_exception:true}); |
+ |
+ var test_load = async_test("test_load"); |
+ window.addEventListener("load", test_load.step_func_done(ev => { |
+ assert_array_equals(log, ["throw"]); |
+ })); |
+ |
+ // Note that there is only one error event. |
+ var test_error = async_test("test_error"); |
+ window.addEventListener("error", test_error.step_func_done(ev => { |
+ console.log(ev); |
+ assert_equals(ev.message, "Uncaught 666"); |
+ assert_array_equals(log, ["throw"]); |
+ |
+ })); |
+ |
+ function unreachable() { |
+ // Insert junk into |log| such that the above |assert_array_equals| |
+ // will fail. |
+ log.push("junk"); |
+ } |
+ |
+ </script> |
+ <script type="module" src="throw.js" onerror="unreachable()"></script> |
+ <script type="module" src="throw.js" onerror="unreachable()"></script> |
+ <script type="module" src="throw.js" async onerror="unreachable()"></script> |
+ <script type="module" src="throw.js" nomodule onerror="unreachable()"></script> |
+</body> |
+</html> |