Bug 475330 - mochitests for xul:tab and xul:tabpanel relations, r=marcoz, davidb
authorAlexander Surkov <surkov.alexander@gmail.com>
Fri, 27 Feb 2009 19:01:33 +0800
changeset 25592 93f48a9db4d78f4f69aa6810e852f283b9776cab
parent 25591 f2f97a49b6a1214d1fede58eb8aa889221203a94
child 25593 f20205a9bbd82c28fb7a4caca90f64e6f2732875
push id5634
push usersurkov.alexander@gmail.com
push dateFri, 27 Feb 2009 11:01:55 +0000
treeherdermozilla-central@93f48a9db4d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarcoz, davidb
bugs475330
milestone1.9.2a1pre
Bug 475330 - mochitests for xul:tab and xul:tabpanel relations, r=marcoz, davidb
accessible/src/xul/nsXULTabAccessible.cpp
accessible/tests/mochitest/test_relations.xul
--- a/accessible/src/xul/nsXULTabAccessible.cpp
+++ b/accessible/src/xul/nsXULTabAccessible.cpp
@@ -368,11 +368,11 @@ nsXULTabpanelAccessible::GetRelationByTy
       tabpanelIndex--;
     }
 
     nsCOMPtr<nsIAccessible> acc;
     childAcc->GetNextSibling(getter_AddRefs(acc));
     childAcc.swap(acc);
   }
 
-  return NS_OK;
+  return nsRelUtils::AddTarget(aRelationType, aRelation, foundTabAcc);
 }
 
--- a/accessible/tests/mochitest/test_relations.xul
+++ b/accessible/tests/mochitest/test_relations.xul
@@ -99,16 +99,25 @@
 
       // 'labelled by'/'label for' relation for xul:goupbox and xul:label of
       // xul:caption
       var groupboxAcc = getAccessible("groupbox");
       var labelAcc = groupboxAcc.firstChild;
       testRelation(labelAcc, RELATION_LABEL_FOR, groupboxAcc);
       testRelation(groupboxAcc, RELATION_LABELLED_BY, labelAcc);
 
+      // 'labelled by'/'label for' relations for xul:tab and xul:tabpanel
+      // (fixed in bug 366527)
+      testRelation("tabpanel1", RELATION_LABELLED_BY, "tab1");
+      testRelation("tab1", RELATION_LABEL_FOR, "tabpanel1");
+      testRelation("tabpanel2", RELATION_LABELLED_BY, "tab2");
+      testRelation("tab2", RELATION_LABEL_FOR, "tabpanel2");
+      testRelation("tabpanel3", RELATION_LABELLED_BY, "tab3");
+      testRelation("tab3", RELATION_LABEL_FOR, "tabpanel3");
+
       // finish test
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addLoadEvent(doTest);
   ]]>
   </script>
@@ -178,11 +187,31 @@
     <description id="flowfrom">flow from</description>
 
     <textbox id="textbox"/>
     <button id="submit" default="true" label="Default"/>
 
     <groupbox id="groupbox">
       <caption label="caption"/>
     </groupbox>
+
+    <tabbox>
+      <tabs>
+        <tab label="tab1" id="tab1"/>
+        <tab label="tab2" id="tab2" linkedpanel="tabpanel2"/>
+        <tab label="tab3" id="tab3" linkedpanel="tabpanel3"/>
+      </tabs>
+      <tabpanels>
+        <tabpanel id="tabpanel1">
+          <description>tabpanel1</description>
+        </tabpanel>
+        <tabpanel id="tabpanel3">
+          <description>tabpanel3</description>
+        </tabpanel>
+        <tabpanel id="tabpanel2">
+          <description>tabpanel2</description>
+        </tabpanel>
+      </tabpanels>
+    </tabbox>
+
  </vbox>
 </window>