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

Side by Side Diff: third_party/WebKit/LayoutTests/csspaint/resources/test-runner-paint-helper.js

Issue 2826983002: Rename Worklet.import() to Worklet.addModule(). (Closed)
Patch Set: Fixing Layout Tests Created 3 years, 8 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
OLDNEW
1 // Given a set of 'tests', runs them in the worklet, then comparing the 1 // Given a set of 'tests', runs them in the worklet, then comparing the
2 // expectedError or the expectedMessage. 2 // expectedError or the expectedMessage.
3 // 3 //
4 // Usage: 4 // Usage:
5 // runner([{/* test1 */}, { /* test2 */}]); 5 // runner([{/* test1 */}, { /* test2 */}]);
6 function runner(tests) { 6 function runner(tests) {
7 if (window.testRunner) { 7 if (window.testRunner) {
8 testRunner.waitUntilDone(); 8 testRunner.waitUntilDone();
9 testRunner.dumpAsText(); 9 testRunner.dumpAsText();
10 } 10 }
11 11
12 tests.reduce(function(chain, obj) { 12 tests.reduce(function(chain, obj) {
13 return chain.then(function() { 13 return chain.then(function() {
14 if (obj.expectedError) { 14 if (obj.expectedError) {
15 console.log('The worklet should throw an error with: "' + obj.ex pectedError + '"'); 15 console.log('The worklet should throw an error with: "' + obj.ex pectedError + '"');
16 } else if (obj.expectedMessage) { 16 } else if (obj.expectedMessage) {
17 console.log('The worklet should log a warning with: "' + obj.exp ectedMessage + '"'); 17 console.log('The worklet should log a warning with: "' + obj.exp ectedMessage + '"');
18 } else { 18 } else {
19 console.log('The worklet should not throw an error.'); 19 console.log('The worklet should not throw an error.');
20 } 20 }
21 var blob = new Blob([obj.script], {type: 'text/javascript'}); 21 var blob = new Blob([obj.script], {type: 'text/javascript'});
22 return paintWorklet.import(URL.createObjectURL(blob)); 22 return paintWorklet.addModule(URL.createObjectURL(blob));
23 }); 23 });
24 }, Promise.resolve()).then(function() { 24 }, Promise.resolve()).then(function() {
25 if (window.testRunner) { 25 if (window.testRunner) {
26 testRunner.notifyDone(); 26 testRunner.notifyDone();
27 } 27 }
28 }); 28 });
29 } 29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698