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

Unified Diff: third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-toBlob-invalid.html

Issue 1669713002: Reland Simplify CanvasAsyncBlobCreator by removing ContextObserver and tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed leak problem Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-toBlob-invalid.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid.html b/third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-toBlob-invalid.html
similarity index 50%
rename from third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid.html
rename to third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-toBlob-invalid.html
index c4633f273419f458f2126c1a95c83018b7f7c9c7..679441271fbf7e52ae0f066a55f81869fe0d4e88 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-toBlob-invalid.html
+++ b/third_party/WebKit/LayoutTests/virtual/threaded/fast/canvas-toBlob/canvas-toBlob-invalid.html
@@ -1,7 +1,21 @@
-<script src="../../resources/js-test.js"></script>
+<script src="../../../../resources/js-test.js"></script>
<script type='text/javascript'>
description("Test the handling of invalid arguments in canvas toBlob().");
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+var numAsyncCalls = 2;
+function finishOneAsyncCall()
+{
+ numAsyncCalls--;
+ if (numAsyncCalls == 0 && window.testRunner) {
+ testRunner.notifyDone();
+ }
+}
+
var canvas = document.createElement('canvas');
var ctx = canvas.getContext("2d");
ctx.strokeStyle = "red";
@@ -11,8 +25,8 @@ shouldThrow("canvas.toBlob();");
shouldThrow("canvas.toBlob(null);");
shouldThrow("canvas.toBlob(undefined);");
// Passing the callback argument without blob handle silently fails.
-shouldNotThrow("canvas.toBlob(function() {});");
+shouldNotThrow("canvas.toBlob(function() { finishOneAsyncCall(); });");
// Invalid quality argument will fall back to default value
-shouldNotThrow("canvas.toBlob(function(blob) {}, 'image/jpeg', 500)");
+shouldNotThrow("canvas.toBlob(function(blob) { finishOneAsyncCall(); }, 'image/jpeg', 500)");
</script>

Powered by Google App Engine
This is Rietveld 408576698