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

Unified Diff: chrome/test/data/workers/incognito_worker.html

Issue 441022: Changed shared worker code so incognito windows do not have access to non-incognito shared workers. (Closed)
Patch Set: Removed superfluous valgrind change. Created 11 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: chrome/test/data/workers/incognito_worker.html
diff --git a/chrome/test/data/workers/incognito_worker.html b/chrome/test/data/workers/incognito_worker.html
new file mode 100644
index 0000000000000000000000000000000000000000..d8ba3ace438f32ae3fea34eb27e44d9550449faa
--- /dev/null
+++ b/chrome/test/data/workers/incognito_worker.html
@@ -0,0 +1,34 @@
+<html>
+
+<head>
+<title>Incognito Worker Test</title>
+
+<script src="worker_utils.js"></script>
+
+<script>
+var worker = new SharedWorker("incognito_worker.js");
+// Worker should only get a single connect event.
+worker.port.onmessage = function(evt) {
+ if (evt.data != 1) {
+ // This instance should not be shared with other pre-existing instances,
+ // so the connect count should be 1.
+ onFailure();
+ return;
+ }
+ // Make a second worker, make sure it shares this instance
+ var worker = new SharedWorker("incognito_worker.js");
+ worker.port.onmessage = function(evt) {
+ if (evt.data == 2)
+ onSuccess();
+ else
+ onFailure();
+ };
+};
+
+</script>
+</head>
+
+<body>
+<div id=statusPanel></div>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698