Index: third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/compilation-error-1.html |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/compilation-error-1.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/compilation-error-1.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c8d4c031e3e5a8d8f1ca5a14c42ccebc85625065 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/compilation-error-1.html |
@@ -0,0 +1,32 @@ |
+<!DOCTYPE html> |
+<html> |
domenic
2017/04/28 20:12:02
General style guidelines: the Microsoft tests have
|
+<head> |
+ <title>html-script-module-compilation-error-1</title> |
+ <script src="/resources/testharness.js"></script> |
+ <script src="/resources/testharnessreport.js"></script> |
+</head> |
+<body> |
+ <h1>html-script-module-compilation-error-1</h1> |
+ <script> |
+ |
+ setup({allow_uncaught_exception: true}); |
+ |
+ window.addEventListener("error", ev => log.push(ev.error)); |
+ |
+ var log = []; |
+ |
+ var test_load = async_test("test_load"); |
domenic
2017/04/28 20:12:02
Test names should be informative, e.g. "Syntax err
|
+ window.addEventListener("load", test_load.step_func_done(ev => { |
+ assert_equals(log.length, 2); |
domenic
2017/04/28 20:12:02
This should be 5, I believe. The script is in an e
neis
2017/05/02 13:51:59
Done.
|
+ assert_true(log[0] instanceof SyntaxError); |
domenic
2017/04/28 20:12:02
This might be better as assert_equals(log[0].const
|
+ assert_true(log.every(exn => exn === log[0])); |
domenic
2017/04/28 20:12:02
For assert_true, I like giving a message so that i
|
+ })); |
domenic
2017/04/28 20:12:02
Since this is a single test, you can omit the asyn
neis
2017/05/02 13:51:59
I wasn't able to make this work. Even without call
|
+ |
+ </script> |
+ <script type="module" src="./syntaxerror.js"></script> |
domenic
2017/04/28 20:12:02
We should add onerror="assert_unreached('1st')" et
neis
2017/05/02 13:51:59
assert_unreached() didn't work for me, that's why
|
+ <script type="module" src="./syntaxerror.js"></script> |
+ <script type="module" src="./syntaxerror-nested.js"></script> |
+ <script type="module" src="./syntaxerror.js"></script> |
+ <script type="module" src="./syntaxerror-nested.js"></script> |
+</body> |
+</html> |