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

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

Issue 821303006: bindings: Fixes layouttests when moving attributes to prototype chains. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed review comments. Created 5 years, 11 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
1 function runTests(event) { 1 function runTests(event) {
2 var tests = event.data; 2 var tests = event.data;
3 var results = []; 3 var results = [];
4 for (var i = 0; i < tests.length; i++) { 4 for (var i = 0; i < tests.length; i++) {
5 try { 5 try {
6 results.push(eval(tests[i])); 6 results.push(eval(tests[i]));
7 } catch(e) { 7 } catch(e) {
8 results.push(e); 8 results.push(e);
9 } 9 }
10 } 10 }
11 return results; 11 return results;
12 } 12 }
13 13
14 self.onmessage = function(event) { 14 self.onmessage = function(event) {
15 var results = runTests(event); 15 var results = runTests(event);
16 postMessage(results); 16 postMessage(results);
17 self.close(); 17 self.close();
18 }; 18 };
19 19
20 self.addEventListener("connect", function(event) { 20 self.addEventListener("connect", function(event) {
21 var port = event.ports[0]; 21 var port = event.ports[0];
22 port.onmessage = function(event) { 22 port.onmessage = function(event) {
23 var results = runTests(event); 23 var results = runTests(event);
24 port.postMessage(results); 24 port.postMessage(results);
25 }; 25 };
26 }); 26 });
27
28 // Stringifies a DOM object. This function stringifies not only own properties
29 // but also DOM attributes which are on a prototype chain. Note that
30 // JSON.stringify only stringifies own properties.
31 function stringifyDOMObject(domObject) {
jsbell 2015/01/22 17:57:29 Hrm, I just noticed LayoutTests/http/tests/w3c/REA
Yuki 2015/01/23 08:06:20 Reverted this file and fixed performance-memory-in
32 var object = {};
33 for (var property in domObject) {
34 object[property] = domObject[property];
35 }
36 return JSON.stringify(object);
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698