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

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

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

Powered by Google App Engine
This is Rietveld 408576698