| Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-case-insensitive-mimetype.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-case-insensitive-mimetype.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-case-insensitive-mimetype.html
|
| index dc48053196fb9abb1dbbb1d56c69c639e3a7075d..28b9b097c40c2b6f34ca739644ed82ed9b77fee8 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-case-insensitive-mimetype.html
|
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-case-insensitive-mimetype.html
|
| @@ -1,45 +1,34 @@
|
| -<script src = "../../resources/js-test.js"></script>
|
| -<script type = "text/javascript">
|
| -if (window.testRunner)
|
| -{
|
| - testRunner.dumpAsText();
|
| - testRunner.waitUntilDone();
|
| -}
|
| -
|
| -description("Test that toBlob(mimeType) ignores the case of 'mimeType'.");
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
|
|
| +<script>
|
| canvas = document.createElement('canvas');
|
| -var counter;
|
|
|
| -function tryMimeType(mimeType, expectedMimeType)
|
| +function tryMimeType(t, mimeType, expectedMimeType)
|
| {
|
| canvas.toBlob(function(blob) {
|
| - if (blob.type === expectedMimeType) {
|
| - testPassed("");
|
| - }
|
| - else {
|
| - testFailed(blob.type + " does not match " + expectedMimeType);
|
| - }
|
| - counter = counter - 1;
|
| - if (window.testRunner) {
|
| - if (counter == 0) {
|
| - testRunner.notifyDone();
|
| - }
|
| - }
|
| + t.step_func(function() {
|
| + assert_true(blob.type === expectedMimeType);
|
| + });
|
| + t.done();
|
| }, mimeType);
|
| }
|
|
|
| -counter = 4;
|
| -
|
| -//Note that due to the async nature of toBlob, these callbacks may complete
|
| -// at random order but they will all print PASS when they pass.
|
| -tryMimeType("image/PNG", "image/png");
|
| +async_test(t => {
|
| + tryMimeType(t, "image/PNG", "image/png");
|
| +}, "Test that toBlob(mimeType) ignores the case of 'mimeType' (PNG).");
|
|
|
| -tryMimeType("imaGE/jpEg", "image/jpeg");
|
| +async_test(t => {
|
| + tryMimeType(t, "imaGE/jpEg", "image/jpeg");
|
| +}, "Test that toBlob(mimeType) ignores the case of 'mimeType' (JPEG).");
|
|
|
| -tryMimeType("ImAgE/WeBp", "image/webp");
|
| +async_test(t => {
|
| + tryMimeType(t, "ImAgE/WeBp", "image/webp");
|
| +}, "Test that toBlob(mimeType) ignores the case of 'mimeType' (WEBP).");
|
|
|
| -//Unsupported mime type falls back to png
|
| -tryMimeType("image/bmp", "image/png");
|
| +async_test(t => {
|
| + // Unsupported mime type falls back to png
|
| + tryMimeType(t, "image/bmp", "image/png");
|
| +}, "Test that unsupported mime type falls back to png.");
|
|
|
| -</Script>
|
| +</script>
|
|
|