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

Unified Diff: LayoutTests/accessibility/aria-orientation.html

Issue 1346733002: Added layout test for aria-orientation and cleaned up code. Also exposed hr element with an orienta… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | LayoutTests/accessibility/aria-orientation-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/accessibility/aria-orientation.html
diff --git a/LayoutTests/accessibility/aria-orientation.html b/LayoutTests/accessibility/aria-orientation.html
new file mode 100644
index 0000000000000000000000000000000000000000..c625d8ddba120a0971edf312c635a4e5c0dd5475
--- /dev/null
+++ b/LayoutTests/accessibility/aria-orientation.html
@@ -0,0 +1,112 @@
+<!DOCTYPE html>
+<script src="../resources/js-test.js"></script>
+
+<div id="slider1" role="slider"
+ aria-valuemin="0" aria-valuemax="100" aria-valuenow="50">
+ 50
+</div>
+<div id="slider2" role="slider" aria-orientation="vertical"
+ aria-valuemin="0" aria-valuemax="100" aria-valuenow="50">
+ 50
+</div>
+<div id="slider3" role="slider" aria-orientation="horizontal"
+ aria-valuemin="0" aria-valuemax="100" aria-valuenow="50">
+ 50
+</div>
+<div id="scrollbar1" role="scrollbar"
+ aria-valuemin="0" aria-valuemax="100" aria-valuenow="50">
+ 50
+</div>
+<div id="scrollbar2" role="scrollbar" aria-orientation="vertical"
+ aria-valuemin="0" aria-valuemax="100" aria-valuenow="50">
+ 50
+</div>
+<div id="scrollbar3" role="scrollbar" aria-orientation="horizontal"
+ aria-valuemin="0" aria-valuemax="100" aria-valuenow="50">
+ 50
+</div>
+<div id="separator1" role="separator">
+</div>
+<div id="separator2" role="separator" aria-orientation="vertical">
+</div>
+<div id="separator3" role="separator" aria-orientation="horizontal">
+</div>
+<!-- TODO(nektar): Expose hr element. -->
+<hr id="separator4">
+
+<!-- Default orientation should be exposed as defined by the ARIA Spec. -->
+<div id="toolbar1" role="toolbar"></div>
+<div id="toolbar2" role="toolbar" aria-orientation="vertical"></div>
+<div id="toolbar3" role="toolbar" aria-orientation="horizontal"></div>
+<div id="radiogroup1" role="radiogroup">
+ <span role="radio">Radio button.</span>
+</div>
+<div id="radiogroup2" role="radiogroup" aria-orientation="vertical">
+ <span role="radio">Radio button.</span>
+</div>
+<div id="radiogroup3" role="radiogroup" aria-orientation="horizontal">
+ <span role="radio">Radio button.</span>
+</div>
+
+<script>
+ description("This tests that aria-orientation is reported correctly.");
+
+ if (window.accessibilityController) {
+
+ for (var i = 1; i < 4; ++i) {
+ var sliderId = "slider" + i;
+ var slider = accessibilityController.accessibleElementById(
+ sliderId);
+ if (i == 1 || i == 3)
dmazzoni 2015/09/15 22:43:01 How about if the intended orientation is just an a
+ shouldBe("slider.orientation",
+ "'AXOrientation: AXHorizontalOrientation'");
+ else if (i == 2)
+ shouldBe("slider.orientation",
+ "'AXOrientation: AXVerticalOrientation'");
+ }
+
+ for (var i = 1; i < 4; ++i) {
+ var scrollbarId = "scrollbar" + i;
+ var scrollbar = accessibilityController.accessibleElementById(
+ scrollbarId);
+ if (i == 1 || i == 2)
+ shouldBe("scrollbar.orientation",
+ "'AXOrientation: AXVerticalOrientation'");
+ else if (i == 3)
+ shouldBe("scrollbar.orientation",
+ "'AXOrientation: AXHorizontalOrientation'");
+ }
+
+ for (var i = 1; i < 4; ++i) {
+ var separatorId = "separator" + i;
+ var separator = accessibilityController.accessibleElementById(
+ separatorId);
+ if (i == 1 || i == 3 || i == 4)
+ shouldBe("separator.orientation",
+ "'AXOrientation: AXHorizontalOrientation'");
+ else if (i == 2)
+ shouldBe("separator.orientation",
+ "'AXOrientation: AXVerticalOrientation'");
+ }
+
+ for (var i = 1; i < 4; ++i) {
+ var toolbarId = "toolbar" + i;
+ var toolbar = accessibilityController.accessibleElementById(
+ toolbarId);
+ if (i == 1 || i == 3)
+ shouldBe("toolbar.orientation",
+ "'AXOrientation: AXHorizontalOrientation'");
+ else if (i == 2)
+ shouldBe("toolbar.orientation",
+ "'AXOrientation: AXVerticalOrientation'");
+ }
+
+ for (var i = 1; i < 4; ++i) {
+ var radioGroupId = "radiogroup" + i;
+ var radioGroup = accessibilityController.accessibleElementById(
+ radioGroupId);
+ shouldBe("radioGroup.orientation", "''");
+ }
+
+ }
+</script>
« no previous file with comments | « no previous file | LayoutTests/accessibility/aria-orientation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698