Index: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/ping.js |
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/ping.js b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/ping.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..db2f3bd35dcc190c9e2ad6e53ebbc867336d59b0 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/ping.js |
@@ -0,0 +1,19 @@ |
+// Service Worker: |
+if (typeof ServiceWorkerGlobalScope) { |
+ self.onmessage = function (e) { e.source.postMessage("ping"); }; |
+} |
+ |
+// Shared Workers: |
+if (typeof SharedWorkerGlobalScope) { |
+ onconnect = function (e) { |
+ var port = e.ports[0]; |
+ |
+ port.onmessage = function () { port.postMessage("ping"); } |
+ port.postMessage("ping"); |
+ }; |
+} |
+ |
+// Dedicated web workers: |
foolip
2016/11/09 16:17:52
No typeof DedicatedWorkerGlobalScope? Does this re
|
+if (self.postMessage) { |
+ self.postMessage("ping"); |
+} |