Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-toDataURL-race-imageEncoder-jpeg.html |
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-toDataURL-race-imageEncoder-jpeg.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-toDataURL-race-imageEncoder-jpeg.html |
index 0796fcee37f50c86e063fe6c68435598b7bff048..5b8bd7f1fd36b71cf9cf47b72d3c4d97a60f3017 100644 |
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-toDataURL-race-imageEncoder-jpeg.html |
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-toDataURL-race-imageEncoder-jpeg.html |
@@ -1,21 +1,27 @@ |
-<script src = "../../resources/js-test.js"></script> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
<script src = "./script-tests/canvas-toBlob-toDataURL-race.js"></script> |
-<script type = 'text/javascript'> |
-description("Verifies if JPEG image encoding on main thread (toDataURL) conflicts with image encoding on async thread (toBlob)"); |
-//Fire a bunch of toBlob operations of canvas to keep the async thread busy |
-var j = 0; // due to async nature of toBlob we need a separate counter |
-for (var i = 0; i < numToBlobCalls; i++) |
-{ |
- canvas.toBlob(function(blob) { |
- url = URL.createObjectURL(blob); |
- testImages[j++].src = url; |
- }, "image/jpeg", 1.0); |
-} |
+<script> |
+async_test(function(t) { |
-//Then file a bunch of toDataURL operation on main thread, so both threads now compete for image encoding |
-for (var i = numToBlobCalls; i < (numToDataURLCalls + numToBlobCalls); i++) |
-{ |
- testImages[i].src = canvas.toDataURL("image/jpeg", 1.0); |
-} |
+ createAllTestCases(t); |
+ |
+ //Fire a bunch of toBlob operations of canvas to keep the async thread busy |
+ var j = 0; // due to async nature of toBlob we need a separate counter |
+ for (var i = 0; i < numToBlobCalls; i++) |
+ { |
+ canvas.toBlob(function(blob) { |
+ url = URL.createObjectURL(blob); |
+ testImages[j++].src = url; |
+ }, "image/jpeg", 1.0); |
+ } |
+ |
+ //Then file a bunch of toDataURL operation on main thread, so both threads now compete for image encoding |
+ for (var i = numToBlobCalls; i < (numToDataURLCalls + numToBlobCalls); i++) |
+ { |
+ testImages[i].src = canvas.toDataURL("image/jpeg", 1.0); |
+ } |
+ |
+}, "Verifies if JPEG image encoding on main thread (toDataURL) conflicts with image encoding on async thread (toBlob)"); |
</script> |