| Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid.html
|
| index 913654022c36e2675defd24737f97027a9141e5e..831829101141947adcf8e30cb1e10c11ecf82d24 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid.html
|
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid.html
|
| @@ -1,32 +1,29 @@
|
| -<script src="../../resources/js-test.js"></script>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| <script type='text/javascript'>
|
| -description("Test the handling of invalid arguments in canvas toBlob().");
|
| +async_test(t => {
|
|
|
| -if (window.testRunner) {
|
| - testRunner.dumpAsText();
|
| - testRunner.waitUntilDone();
|
| -}
|
| -
|
| -var numAsyncCalls = 2;
|
| -function finishOneAsyncCall()
|
| -{
|
| - numAsyncCalls--;
|
| - if (numAsyncCalls == 0 && window.testRunner) {
|
| - testRunner.notifyDone();
|
| + var numAsyncCalls = 2;
|
| + function finishOneAsyncCall()
|
| + {
|
| + if (--numAsyncCalls == 0)
|
| + t.done();
|
| }
|
| -}
|
| -
|
| -var canvas = document.createElement('canvas');
|
| -var ctx = canvas.getContext("2d");
|
| -ctx.strokeStyle = "red";
|
| -ctx.strokeRect(0, 0, 50, 50);
|
| -
|
| -shouldThrow("canvas.toBlob();");
|
| -shouldThrow("canvas.toBlob(null);");
|
| -shouldThrow("canvas.toBlob(undefined);");
|
| -// Passing the callback argument without blob handle silently fails.
|
| -shouldNotThrow("canvas.toBlob(function() { finishOneAsyncCall(); });");
|
| +
|
| + var canvas = document.createElement('canvas');
|
| + var ctx = canvas.getContext("2d");
|
| + ctx.strokeStyle = "red";
|
| + ctx.strokeRect(0, 0, 50, 50);
|
| +
|
| + assert_throws(new TypeError(), function() {canvas.toBlob();});
|
| + assert_throws(new TypeError(), function() {canvas.toBlob(null);});
|
| + assert_throws(new TypeError(), function() {canvas.toBlob(undefined);});
|
|
|
| -// Invalid quality argument will fall back to default value
|
| -shouldNotThrow("canvas.toBlob(function(blob) { finishOneAsyncCall(); }, 'image/jpeg', 500)");
|
| + // Passing the callback argument without blob handle silently fails.
|
| + canvas.toBlob(function() { finishOneAsyncCall(); });
|
| +
|
| + // Invalid quality argument will fall back to default value
|
| + canvas.toBlob(function(blob) { finishOneAsyncCall(); }, 'image/jpeg', 500);
|
| +
|
| +}, "Test the handling of invalid arguments in canvas toBlob().");
|
| </script>
|
|
|