Index: chrome/test/data/workers/many_shared_workers.html |
diff --git a/chrome/test/data/workers/many_shared_workers.html b/chrome/test/data/workers/many_shared_workers.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2958e8502386399d5721a115d46b4da8f43a6ba4 |
--- /dev/null |
+++ b/chrome/test/data/workers/many_shared_workers.html |
@@ -0,0 +1,38 @@ |
+<html> |
+<body> |
+<div id=result></div> |
+<script> |
+function log(message) |
+{ |
+ document.getElementById("result").innerHTML += message + "<br>"; |
+} |
+ |
+var url = document.location.toString(); |
+var num_workers = parseInt(url.substr(url.search("count=") + 6)); |
+ |
+if (!num_workers) { |
+ log("No count= parameter provided - test aborted"); |
+} |
+ |
+for (var i = 0; i < num_workers ; ++i) { |
+ createWorker(i); |
+} |
+ |
+var workers_created = 0; |
+function createWorker(i) { |
+ var worker = new SharedWorker("worker_common.js?id=" + i); |
+ worker.port.postMessage("eval num_clients"); |
+ worker.port.onmessage = function(event) { |
+ workers_created++; |
+ log("worker " + i + " started - num_clients = " + event.data); |
+ if (workers_created == num_workers) { |
+ // created the last worker |
+ log("SUCCESS: all workers created"); |
+ document.cookie = "status=OK"; |
+ } |
+ } |
+} |
+</script> |
+ |
+</body> |
+</html> |