Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/errorhandling.html

Issue 2695813009: Import wpt@503f5b5f78ec4e87d144f78609f363f0ed0ea8db (Closed)
Patch Set: Skip some tests Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <title>html-script-module-errorHandling</title>
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
7 <style>
8
9 iframe
10 { display: none; }
11
12 </style>
13 </head>
14 <body>
15 <h1>html-script-module-errorHandling</h1>
16 <iframe id="iframe_parseError_Root" src="errorhandling-parseerror-root.html" ></iframe>
17 <iframe id="iframe_parseError_Dependent" src="errorhandling-parseerror-depen dent.html"></iframe>
18 <iframe id="iframe_parseError_DependentMultiple" src="errorhandling-parseerr or-dependentmultiple.html"></iframe>
19 <script>
20
21 var tests = [
22 { "id": "iframe_parseError_Root", "expected": "error" },
23 { "id": "iframe_parseError_Dependent", "expected": "error" } ,
24 { "id": "iframe_parseError_DependentMultiple", "expected": " error,error" },
25 ];
26 tests.forEach(function (testObj) {
27 var testHandle = async_test("IFrame test: '" + testObj.id + "'");
28 var testTarget = document.getElementById(testObj.id);
29 testTarget.addEventListener("load", testHandle.step_func(function () {
30 assert_equals(testTarget.contentDocument._errorReported, testObj .expected, "Unexpected _errorReported value");
31 testHandle.done();
32 }));
33 });
34
35 var test_wrongMimetype_root = async_test("External root module with non- script mimetype");
36 var script_wrongMimetype_root = document.createElement("script");
37 script_wrongMimetype_root.type = "module";
38 script_wrongMimetype_root.src = "errorhandling-wrongMimetype.js?pipe=hea der(Content-Type,text/plain),header(X-Content-Type-Options,nosniff)";
39 script_wrongMimetype_root.addEventListener("error", test_wrongMimetype_r oot.step_func(function () {
40 test_wrongMimetype_root.done();
41 }));
42 script_wrongMimetype_root.addEventListener("load", test_wrongMimetype_ro ot.step_func(function () {
43 assert_unreached("This script should not have loaded!");
44 }));
45 document.body.appendChild(script_wrongMimetype_root);
46
47 var test_wrongMimetype_import = async_test("Module with imported non-scr ipt mimetype");
48 var script_wrongMimetype_import = document.createElement("script");
49 script_wrongMimetype_import.type = "module";
50 script_wrongMimetype_import.src = "errorhandling-wrongMimetype-import.js ";
51 script_wrongMimetype_import.addEventListener("error", test_wrongMimetype _import.step_func(function () {
52 test_wrongMimetype_import.done();
53 }));
54 script_wrongMimetype_import.addEventListener("load", test_wrongMimetype_ import.step_func(function () {
55 assert_unreached("This script should not have loaded!");
56 }));
57 document.body.appendChild(script_wrongMimetype_import);
58
59 </script>
60 </body>
61 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698