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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/fetch/nosniff/importscripts.js

Issue 2778753002: Import //fetch from Web Platform Tests. (Closed)
Patch Set: Baselines. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/external/wpt/fetch/nosniff/importscripts.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/nosniff/importscripts.js b/third_party/WebKit/LayoutTests/external/wpt/fetch/nosniff/importscripts.js
new file mode 100644
index 0000000000000000000000000000000000000000..aeb6154870b7e1d980594f7f042429f953a7cd02
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/nosniff/importscripts.js
@@ -0,0 +1,17 @@
+// Testing importScripts()
+function log(w) { this.postMessage(w) }
+function f() { log("FAIL") }
+function p() { log("PASS") }
+
+["", "?type=", "?type=x", "?type=x/x"].forEach(function(urlpart) {
+ try {
+ importScripts("resources/js.py" + urlpart)
+ } catch(e) {
+ (e.name == "NetworkError") ? p() : log("FAIL (no NetworkError exception): " + urlpart)
+ }
+
+})
+importScripts("resources/js.py?type=text/javascript&outcome=p")
+importScripts("resources/js.py?type=text/ecmascript&outcome=p")
+importScripts("resources/js.py?type=text/ecmascript;blah&outcome=p")
+log("END")

Powered by Google App Engine
This is Rietveld 408576698