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

Side by Side Diff: LayoutTests/http/tests/w3c/webperf/resources/worker.js

Issue 16434011: Support performance.now() in workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix WorkerPerformance IDL Created 7 years, 6 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 function runTests(event) {
2 var tests = JSON.parse(event.data);
3 var results = [];
4 for (var i = 0; i < tests.length; i++) {
5 try {
6 results.push(eval(tests[i]));
7 } catch(e) {
8 results.push(e);
9 }
10 }
11 return results;
12 }
13
14 self.onmessage = function(event) {
15 var results = runTests(event);
16 postMessage(JSON.stringify(results));
abarth-chromium 2013/06/12 23:11:41 You probably don't need to use JSON encoding here.
James Simonsen 2013/06/13 00:01:36 Oh nice. Thanks.
17 self.close();
18 };
19
20 self.addEventListener("connect", function(event) {
21 var port = event.ports[0];
22 port.onmessage = function(event) {
23 var results = runTests(event);
24 port.postMessage(JSON.stringify(results));
25 };
26 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698