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

Unified Diff: LayoutTests/accessibility/draw-custom-focus-ring.html

Issue 19786002: Implement canvas focus ring methods. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove unused IntRect array Created 7 years, 5 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: LayoutTests/accessibility/draw-custom-focus-ring.html
diff --git a/LayoutTests/accessibility/draw-custom-focus-ring.html b/LayoutTests/accessibility/draw-custom-focus-ring.html
new file mode 100644
index 0000000000000000000000000000000000000000..c3725b8b97a881dbebc5803eaa3cb92d44e243c5
--- /dev/null
+++ b/LayoutTests/accessibility/draw-custom-focus-ring.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML>
+<head>
+<title>Canvas test: drawSystemFocusRing</title>
+<script src="../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body style="padding: 0; margin: 0">
+<canvas id="canvas" class="output" width="300" height="350">
+ <button id="button1"></button>
+ <button id="button2"></button>
+</canvas>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+if (window.accessibilityController) {
+ window.axButton1 = window.accessibilityController.accessibleElementById("button1");
+ window.axButton2 = window.accessibilityController.accessibleElementById("button2");
+}
+
+var canvas = document.getElementById("canvas").getContext("2d");
+canvas.beginPath();
+canvas.rect(50, 50, 200, 100);
+canvas.fillStyle = '#ccf';
+canvas.fill();
+canvas.drawCustomFocusRing(document.getElementById('button1'));
+
+canvas.beginPath();
+canvas.rect(50, 200, 200, 100);
+canvas.fillStyle = '#cfc';
+canvas.fill();
+canvas.drawCustomFocusRing(document.getElementById('button2'));
+
+shouldBe("axButton1.x", "50");
+shouldBe("axButton1.y", "50");
+shouldBe("axButton1.width", "200");
+shouldBe("axButton1.height", "100");
+
+shouldBe("axButton2.x", "50");
+shouldBe("axButton2.y", "200");
+shouldBe("axButton2.width", "200");
+shouldBe("axButton2.height", "100");
+</script>
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698