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

Side by Side Diff: chrome/test/data/workers/queued_shared_worker_shutdown.html

Issue 10821016: Delete chrome/test/data/workers since it's not used anymore. It was copied in r148205 in preparatio… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="worker_utils.js"></script>
4 </head>
5 <body>
6 <div id=result></div>
7 <script>
8 function log(message)
9 {
10 document.getElementById("result").innerHTML += message + "<br>";
11 }
12
13 var url = document.location.toString();
14 var num_workers = parseInt(url.substr(url.search("count=") + 6));
15
16 if (!num_workers) {
17 log("No count= parameter provided - test aborted");
18 } else {
19 for (var i = 0; i < num_workers ; ++i) {
20 createWorker(i);
21 }
22
23 // Create two extra workers - these should both be queued, and launched as a
24 // single instance when we shutdown a worker.
25 createWorker(num_workers);
26 createWorker(num_workers);
27 }
28
29 var workers_created = 0;
30 function createWorker(i) {
31 var worker = new SharedWorker("worker_common.js?id=" + i);
32 worker.port.postMessage("ping");
33 worker.port.onmessage = function() {
34 workers_created++;
35 log("worker " + i + " started");
36 if (workers_created == num_workers) {
37 // We've created all of our workers. Let's shut down the most recent one
38 // and see if we startup the queued worker.
39 log("Shutting down worker " + i);
40 worker.port.postMessage("close");
41 } else if (workers_created == (num_workers+2)) {
42 // created the last worker
43 log("SUCCESS: queued worker created");
44 onSuccess();
45 }
46 }
47 }
48 </script>
49
50 </body>
51 </html>
OLDNEW
« no previous file with comments | « chrome/test/data/workers/multi_worker.html ('k') | chrome/test/data/workers/shared_worker_auth.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698