Bug 660461 - attributes/test_obj_group.xul random fail | Can't get accessible for menu_item2.1, An error occurred - acc is null, r=tbsaunde
authorAlexander Surkov <surkov.alexander@gmail.com>
Sun, 24 Jul 2011 21:45:23 +0900
changeset 73237 99644756e69e5fec1bc4e3a563df947146049df5
parent 73236 ad1655c2e5b1e3d6120edadf2e8f2b2d7962a33d
child 73238 de43fbe04808c19e39f91d93daf070be754abe26
push id20837
push usersurkov.alexander@gmail.com
push dateSun, 24 Jul 2011 12:45:55 +0000
treeherdermozilla-central@99644756e69e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs660461
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 660461 - attributes/test_obj_group.xul random fail | Can't get accessible for menu_item2.1, An error occurred - acc is null, r=tbsaunde
accessible/tests/mochitest/attributes/test_obj_group.xul
--- a/accessible/tests/mochitest/attributes/test_obj_group.xul
+++ b/accessible/tests/mochitest/attributes/test_obj_group.xul
@@ -9,74 +9,113 @@
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
           src="../common.js" />
   <script type="application/javascript"
+          src="../events.js" />
+  <script type="application/javascript"
           src="../attributes.js" />
 
   <script type="application/javascript">
   <![CDATA[
+    function openMenu(aID)
+    {
+      this.menuNode = getNode(aID);
+
+      this.eventSeq = [
+        new invokerChecker(EVENT_FOCUS, this.menuNode)
+      ];
+
+      this.invoke = function openMenu_invoke()
+      {
+        this.menuNode.open = true;
+      }
+
+      this.finalCheck = function openMenu_finalCheck()
+      {
+        testGroupAttrs("menu_item1.1", 1, 1);
+        testGroupAttrs("menu_item1.2", 1, 3);
+        testGroupAttrs("menu_item1.4", 2, 3);
+        testGroupAttrs("menu_item2", 3, 3);
+      }
+
+      this.getID = function openMenu_getID()
+      {
+        return "open menu " + prettyName(aID);
+      }
+    }
+
+    function openSubMenu(aID)
+    {
+      this.menuNode = getNode(aID);
+
+      this.eventSeq = [
+        new invokerChecker(EVENT_FOCUS, this.menuNode)
+      ];
+
+      this.invoke = function openSubMenu_invoke()
+      {
+        this.menuNode.open = true;
+      }
+
+      this.finalCheck = function openSubMenu_finalCheck()
+      {
+        testGroupAttrs("menu_item2.1", 1, 2, 1);
+        testGroupAttrs("menu_item2.2", 2, 2, 1);
+      }
+
+      this.getID = function openSubMenu_getID()
+      {
+        return "open submenu " + prettyName(aID);
+      }
+    }
+
+    var gQueue = null;
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // xul:listbox (bug 417317)
       testGroupAttrs("item1", 1, 2);
       testGroupAttrs("item2", 2, 2);
 
       //////////////////////////////////////////////////////////////////////////
-      // xul:menu (bug 443881)
-      var menu1 = document.getElementById("menu_item1");
-      menu1.open = true;
-
-      menu1.addEventListener("popupshown", function() {
-        var menu2 = document.getElementById("menu_item2");
-        menu2.open = true;
-
-        menu2.addEventListener("popupshown", function() {
-          testGroupAttrs("menu_item1.1", 1, 1);
-          testGroupAttrs("menu_item1.2", 1, 3);
-          testGroupAttrs("menu_item1.4", 2, 3);
-          testGroupAttrs("menu_item2", 3, 3);
-          testGroupAttrs("menu_item2.1", 1, 2, 1);
-          testGroupAttrs("menu_item2.2", 2, 2, 1);
-
-          menu1.open = false;
-          menu2.open = false;
-
-          SimpleTest.finish();
-        }, false);
-      }, false);
-
-      //////////////////////////////////////////////////////////////////////////
       // xul:tab
       testGroupAttrs("tab1", 1, 2);
       testGroupAttrs("tab2", 2, 2);
 
       //////////////////////////////////////////////////////////////////////////
       // xul:radio
       testGroupAttrs("radio1", 1, 2);
       testGroupAttrs("radio2", 2, 2);
 
       //////////////////////////////////////////////////////////////////////////
       // ARIA menu (bug 441888)
       testGroupAttrs("aria-menuitem", 1, 3);
       testGroupAttrs("aria-menuitemcheckbox", 2, 3);
       testGroupAttrs("aria-menuitemradio", 3, 3);
       testGroupAttrs("aria-menuitem2", 1, 1);
+
+      //////////////////////////////////////////////////////////////////////////
+      // xul:menu (bug 443881)
+      gQueue = new eventQueue();
+      gQueue.push(new openMenu("menu_item1"));
+      gQueue.push(new openSubMenu("menu_item2"));
+      gQueue.invoke(); // SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   ]]>
   </script>
 
+  <hbox flex="1" style="overflow: auto;">
   <body xmlns="http://www.w3.org/1999/xhtml">
     <a target="_blank"
        href="https://bugzilla.mozilla.org/show_bug.cgi?id=417317"
        title="Certain types of LISTITEM accessibles no longer get attributes set like 'x of y', regression from fix for bug 389926">
       Mozilla Bug 417317
     </a><br/>
     <a target="_blank"
        href="https://bugzilla.mozilla.org/show_bug.cgi?id=443881"
@@ -91,16 +130,17 @@
 
     <p id="display"></p>
     <div id="content" style="display: none">
     </div>
     <pre id="test">
     </pre>
   </body>
 
+  <vbox flex="1">
   <listbox>
     <listitem label="item1" id="item1"/>
     <listitem label="item2" id="item2"/>
   </listbox>
 
   <menubar>
     <menu label="item1" id="menu_item1">
       <menupopup>
@@ -143,10 +183,13 @@
     <description role="menuitem" hidden="true"/>
     <description role="menuitemradio" id="aria-menuitemradio"
                  value="conventional radio menuitem"/>
     <description role="separator"
                  value="conventional separator"/>
     <description role="menuitem" id="aria-menuitem2"
                  value="conventional menuitem"/>
   </vbox>
+
+  </vbox>
+  </hbox>
 </window>