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

Unified Diff: third_party/WebKit/LayoutTests/security/immutable-prototype-worker.js

Issue 2452073002: Freeze global prototype chain per WebIDL (Closed)
Patch Set: Test improvements Created 4 years, 1 month 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/security/immutable-prototype-worker.js
diff --git a/third_party/WebKit/LayoutTests/security/immutable-prototype-worker.js b/third_party/WebKit/LayoutTests/security/immutable-prototype-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..7474b069e517d7d1720763fab330d37ebf9a8a6e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/security/immutable-prototype-worker.js
@@ -0,0 +1,19 @@
+importScripts('immutable-prototype.js');
+
+if (!self.postMessage) {
+ // This is a shared worker - mimic dedicated worker APIs
+ onconnect = function(event) {
+ event.ports[0].onmessage = function(e) {
+ self.postMessage = function (msg) {
+ event.ports[0].postMessage(msg);
+ };
+ run();
+ };
+ };
+} else {
+ run();
+}
+
+function run() {
+ self.postMessage(prototypeChain(self));
+}

Powered by Google App Engine
This is Rietveld 408576698