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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/fetch/nosniff/script.html

Issue 2778753002: Import //fetch from Web Platform Tests. (Closed)
Patch Set: Baselines. Created 3 years, 8 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 <script src=/resources/testharness.js></script>
2 <script src=/resources/testharnessreport.js></script>
3 <div id=log></div>
4 <script>
5 var log = function() {}, // see comment below
6 p = function() {}, // see comment below
7 fails = ["", "?type=", "?type=x", "?type=x/x"],
8 passes = ["?type=text/javascript", "?type=text/ecmascript", "?type=text/ec mascript;blah"]
9
10 // Ideally we'd also check whether the scripts in fact execute, but that would involve
11 // timers and might get a bit racy without cross-browser support for the execu te events.
12
13 fails.forEach(function(urlpart) {
14 async_test(function(t) {
15 var script = document.createElement("script")
16 script.onerror = t.step_func_done(function(){})
17 script.onload = t.unreached_func("Unexpected load event")
18 script.src = "resources/js.py" + urlpart
19 document.body.appendChild(script)
20 }, "URL query: " + urlpart)
21 })
22
23 passes.forEach(function(urlpart) {
24 async_test(function(t) {
25 var script = document.createElement("script")
26 script.onerror = t.unreached_func("Unexpected error event")
27 script.onload = t.step_func_done(function(){})
28 script.src = "resources/js.py" + urlpart + "&outcome=p"
29 document.body.appendChild(script)
30 }, "URL query: " + urlpart)
31 })
32 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698