| OLD | NEW |
| 1 if (window.testRunner) { | 1 if (window.testRunner) { |
| 2 testRunner.dumpAsText(); | |
| 3 testRunner.waitUntilDone(); | 2 testRunner.waitUntilDone(); |
| 4 } | 3 } |
| 5 | 4 |
| 6 // This test should show a table of canvas elements. Onto the background of each
a blue | 5 // This test should show a table of canvas elements. Onto the background of each
a blue |
| 7 // square is drawn, either fully opaque or with some transparency, and then a cl
ip and | 6 // square is drawn, either fully opaque or with some transparency, and then a cl
ip and |
| 8 // transformation is applied. The clip only allows drawing in the left two third
s of the | 7 // transformation is applied. The clip only allows drawing in the left two third
s of the |
| 9 // canvas. | 8 // canvas. |
| 10 | 9 |
| 11 // Once each canvas has been set up, an image is drawn with the composite mode f
or that row. | 10 // Once each canvas has been set up, an image is drawn with the composite mode f
or that row. |
| 12 // Each row uses a different compositing mode. Different columns are used for wh
en the | 11 // Each row uses a different compositing mode. Different columns are used for wh
en the |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 addError(context, testPoints[i].x, testPoints[i].y, actualColor, expectedC
olor); | 345 addError(context, testPoints[i].x, testPoints[i].y, actualColor, expectedC
olor); |
| 347 errorCount++; | 346 errorCount++; |
| 348 } | 347 } |
| 349 } | 348 } |
| 350 if (errorCount) | 349 if (errorCount) |
| 351 addOutput('div', 'fail', 'FAIL: ' + errorCount + ' errors.'); | 350 addOutput('div', 'fail', 'FAIL: ' + errorCount + ' errors.'); |
| 352 else | 351 else |
| 353 addOutput('div', 'pass', 'PASS'); | 352 addOutput('div', 'pass', 'PASS'); |
| 354 } | 353 } |
| 355 | 354 |
| 356 function runTest() { | 355 function runTest(testMode) { |
| 356 if (window.testRunner) { |
| 357 if (testMode == "dumpAsText") { |
| 358 testRunner.dumpAsText(); |
| 359 } else if (testMode == "dumpAsTextWithPixelResults") { |
| 360 testRunner.dumpAsTextWithPixelResults(); |
| 361 } |
| 362 } |
| 357 setupTest(); | 363 setupTest(); |
| 358 createOutputTable(); | 364 createOutputTable(); |
| 359 for (var i = 0; i < compositeTypes.length; i++) { | 365 for (var i = 0; i < compositeTypes.length; i++) { |
| 360 for (var j = 0; j < testNames.length; j++) { | 366 for (var j = 0; j < testNames.length; j++) { |
| 361 var context = getContext(i, j); | 367 var context = getContext(i, j); |
| 362 context.save(); | 368 context.save(); |
| 363 setupContext(context, j % 4 > 1); | 369 setupContext(context, j % 4 > 1); |
| 364 drawImage(context, i, j % 2); | 370 drawImage(context, i, j % 2); |
| 365 context.restore(); | 371 context.restore(); |
| 366 } | 372 } |
| 367 } | 373 } |
| 368 for (var i = 0; i < compositeTypes.length; i++) { | 374 |
| 369 addOutput('h1', '', 'Mode: ' + compositeTypes[i]); | 375 if (testMode == "dumpAsText") { |
| 370 for (var j = 0; j < testNames.length; j++) { | 376 for (var i = 0; i < compositeTypes.length; i++) { |
| 371 addOutput('h2', '', 'Test: ' + testNames[j]); | 377 addOutput('h1', '', 'Mode: ' + compositeTypes[i]); |
| 372 var context = getContext(i, j); | 378 for (var j = 0; j < testNames.length; j++) { |
| 373 checkResult(context, i, j); | 379 addOutput('h2', '', 'Test: ' + testNames[j]); |
| 374 //rebaseline(context, i, j); | 380 var context = getContext(i, j); |
| 381 checkResult(context, i, j); |
| 382 //rebaseline(context, i, j); |
| 383 } |
| 375 } | 384 } |
| 376 } | 385 } |
| 377 if (testRunner) | 386 if (window.testRunner) |
| 378 testRunner.notifyDone(); | 387 testRunner.notifyDone(); |
| 379 } | 388 } |
| OLD | NEW |