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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html

Issue 2036663003: Establish mojo service between Canvas (blink) and SurfaceManager (browser) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: OWNERS change on offscreencanvas folder Created 4 years, 6 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/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html
index 36ba020363fc99fa734b309e3289ba04a3d5b0df..1f168cd124324c8a82ff27d9f6db821eb8bc86dc 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html
@@ -9,19 +9,33 @@
description("Test transferControlToOffscreen.");
window.jsTestIsAsync = true;
+function createCanvas(width, height) {
+ var canvas = document.createElement("canvas");
+ canvas.width = width;
+ canvas.height = height;
+ return canvas;
+}
+
+// Tests whether transferControlToOffscreen can be run correctly.
var width = 50;
var height = 50;
-var canvas = document.createElement("canvas");
-canvas.width = width;
-canvas.height = height;
-
-var offscreenCanvas = canvas.transferControlToOffscreen();
-shouldBe("offscreenCanvas.width", "width");
-shouldBe("offscreenCanvas.height", "height");
+var canvas1 = createCanvas(width, height);
+var offscreenCanvas1;
+try {
+ offscreenCanvas1 = canvas1.transferControlToOffscreen();
+ testPassed("Successfully created layer for offscreencanvas");
+ shouldBe("offscreenCanvas1.width", "width");
+ shouldBe("offscreenCanvas1.height", "height");
+} catch (ex) {
+ testFailed(ex.message);
+}
-var ctx = canvas.getContext("2d");
+// Tests whether transferControlToOffscreen throws exception correctly.
+var canvas2 = createCanvas(50, 50);
+var offscreenCanvas2;
+var ctx = canvas2.getContext("2d");
try {
- offscreenCanvas = canvas.transferControlToOffscreen();
+ offscreenCanvas2 = canvas2.transferControlToOffscreen();
testFailed("transferControlToOffscreen from a canvas with context didn't throw an exception.");
} catch (ex) {
testPassed("transferControlToOffscreen from a canvas with context throws an exception: " + ex);

Powered by Google App Engine
This is Rietveld 408576698