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

Unified Diff: LayoutTests/accessibility/menu-list-selection-changed.html

Issue 1020473004: Fire an event when a menu list option becomes unselected. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add comment about selectedIndex=-1 Created 5 years, 9 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/menu-list-selection-changed-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/accessibility/menu-list-selection-changed.html
diff --git a/LayoutTests/accessibility/menu-list-selection-changed.html b/LayoutTests/accessibility/menu-list-selection-changed.html
new file mode 100644
index 0000000000000000000000000000000000000000..b584cee986add87c1fd8f770efde04ecca03db98
--- /dev/null
+++ b/LayoutTests/accessibility/menu-list-selection-changed.html
@@ -0,0 +1,42 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<script src="../resources/js-test.js"></script>
+
+<select id="menulist">
+ <option id="item0">Alicia</option>
+ <option id="item1">Peter</option>
+ <option id="item2">Kalinda</option>
+</select>
+
+<div id="console"></div>
+<script>
+description("This test makes sure menu lists fire events on both the option that lost selection and the one that gained selection.");
+window.jsTestIsAsync = true;
+
+if (window.testRunner && window.accessibilityController) {
+ window.testRunner.dumpAsText();
+
+ var menulist = document.getElementById("menulist");
+ menulist.selectedIndex = 0;
+
+ // Explore the whole accessibility tree. State change events won't fire on accessible objects that haven't
+ // been created yet.
+ accessibilityController.accessibleElementById('foo');
+
+ var result = "";
+ accessibilityController.addNotificationListener(function(element, notification) {
+ if (element.role == "AXRole: AXMenuListOption") {
+ debug("Got notification on option " + element.stringValue + " isSelected=" + element.isSelected);
+ if (element.isSelected)
+ finishJSTest();
+ }
+ });
+
+ menulist.selectedIndex = 2;
+}
+
+</script>
+
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/accessibility/menu-list-selection-changed-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698