Index: LayoutTests/fast/canvas/draw-focus-if-needed-with-path2d.html |
diff --git a/LayoutTests/fast/canvas/draw-focus-if-needed.html b/LayoutTests/fast/canvas/draw-focus-if-needed-with-path2d.html |
similarity index 68% |
copy from LayoutTests/fast/canvas/draw-focus-if-needed.html |
copy to LayoutTests/fast/canvas/draw-focus-if-needed-with-path2d.html |
index 8bfb2ea3bfefca1cead0a7fbe0dd3cb2a3933937..24731b8fdb5cc620a9a2615a06f123e2c8394da3 100644 |
--- a/LayoutTests/fast/canvas/draw-focus-if-needed.html |
+++ b/LayoutTests/fast/canvas/draw-focus-if-needed-with-path2d.html |
@@ -1,6 +1,6 @@ |
<!DOCTYPE HTML> |
<head> |
-<title>Canvas test: drawFocusIfNeeded</title> |
+<title>Canvas test: drawFocusIfNeeded with Path2D</title> |
<script src="../../resources/js-test.js"></script> |
</head> |
<body style="padding: 0; margin: 0"> |
@@ -16,22 +16,26 @@ document.getElementById("button1").focus(); |
var canvas = document.getElementById("canvas").getContext("2d"); |
+shouldThrow('canvas.drawFocusIfNeeded(undefined);'); |
+shouldThrow('canvas.drawFocusIfNeeded(undefined, undefined);'); |
shouldThrow('canvas.drawFocusIfNeeded(null);'); |
+shouldThrow('canvas.drawFocusIfNeeded(null, null);'); |
shouldThrow('canvas.drawFocusIfNeeded();'); |
-canvas.beginPath(); |
-canvas.rect(50, 50, 200, 100); |
+var path = new Path2D(); |
+path.rect(50, 50, 200, 100); |
canvas.fillStyle = "#ccf"; |
-canvas.fill(); |
+canvas.fill(path); |
// re-test null case after having defined a path (regression test for crbug.com/353248) |
shouldThrow('canvas.drawFocusIfNeeded(null);'); |
-canvas.drawFocusIfNeeded(document.getElementById("button1")); |
+shouldThrow('canvas.drawFocusIfNeeded(null, null);'); |
+canvas.drawFocusIfNeeded(path, document.getElementById("button1")); |
-canvas.beginPath(); |
-canvas.rect(50, 200, 200, 100); |
+path = new Path2D(); |
+path.rect(50, 200, 200, 100); |
canvas.fillStyle = "#cfc"; |
-canvas.fill(); |
-canvas.drawFocusIfNeeded(document.getElementById("button2")); |
+canvas.fill(path); |
+canvas.drawFocusIfNeeded(path, document.getElementById("button2")); |
// The top rect"s focus ring is tied to button1, which is focused. |
// It should have an outline in some color other than the background color. |