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

Side by Side Diff: chrome/test/data/workers/worker_utils.js

Issue 490023: Enabled a number of worker tests on various platforms. (Closed)
Patch Set: Removed erroneous edit to websharedworker_stub.cc Created 11 years 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
« no previous file with comments | « chrome/test/data/workers/worker_common.js ('k') | chrome/worker/worker_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var shared_worker_count = 0;
2 function getWorker(worker_url)
3 {
4 // Create either a dedicated or shared worker, depending on flags
5 var url = document.location.toString();
6 if (url.search("shared") >= 0) {
7 // Make a shared worker that looks like a worker
8 var worker = new SharedWorker(worker_url, "name" + ++shared_worker_count);
9 worker.port.onmessage = function(evt) {
10 worker.onmessage(evt);
11 };
12 worker.postMessage = function(msg, port) {
13 worker.port.postMessage(msg, port);
14 };
15 return worker;
16 } else {
17 return new Worker(worker_url);
18 }
19 }
20
1 function onSuccess() 21 function onSuccess()
2 { 22 {
3 setTimeout(onFinished, 0, "OK"); 23 setTimeout(onFinished, 0, "OK");
4 } 24 }
5 25
6 function onFailure() { 26 function onFailure() {
7 setTimeout(onFinished, 0, "FAIL"); 27 setTimeout(onFinished, 0, "FAIL");
8 } 28 }
9 29
10 function onFinished(result) { 30 function onFinished(result) {
11 var statusPanel = document.getElementById("statusPanel"); 31 var statusPanel = document.getElementById("statusPanel");
12 if (statusPanel) { 32 if (statusPanel) {
13 statusPanel.innerHTML = result; 33 statusPanel.innerHTML = result;
14 } 34 }
15 35
16 var cookie = "status=" + result + "; path=/"; 36 var cookie = "status=" + result + "; path=/";
17 document.cookie = cookie; 37 document.cookie = cookie;
18 } 38 }
OLDNEW
« no previous file with comments | « chrome/test/data/workers/worker_common.js ('k') | chrome/worker/worker_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698