bug 462350 - Refactor and rename test_bug428479.html to test_aria_role_equation.html, r=surkov
authorMarco Zehe <marco.zehe@googlemail.com>
Fri, 31 Oct 2008 13:19:28 +0100
changeset 21143 7c03312dd190eadb91ee867ce4a119ad4e9cdc97
parent 21142 c072c1a950ab28b0a6f3016140f91aa04243a747
child 21144 f1bb0f862b5b6b7afb3988df60affc5f8be23c71
push id3350
push usermzehe@mozilla.com
push dateFri, 31 Oct 2008 12:19:41 +0000
treeherdermozilla-central@7c03312dd190 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs462350, 428479
milestone1.9.1b2pre
bug 462350 - Refactor and rename test_bug428479.html to test_aria_role_equation.html, r=surkov
accessible/tests/mochitest/Makefile.in
accessible/tests/mochitest/common.js
accessible/tests/mochitest/test_aria_role_equation.html
accessible/tests/mochitest/test_bug428479.html
--- a/accessible/tests/mochitest/Makefile.in
+++ b/accessible/tests/mochitest/Makefile.in
@@ -54,16 +54,17 @@ include $(topsrcdir)/config/rules.mk
 		nsIAccessible_name.css \
 		nsIAccessible_name.js \
 		nsIAccessible_name.xbl \
  		nsIAccessible_selects.js \
 		nsIAccessible_states.js \
 		nsIAccessibleEditableText.js \
 		test_aria_activedescendant.html \
 		test_aria_role_article.html \
+		test_aria_role_equation.html \
 		test_bug368835.xul \
 		test_bug420863.html \
 		test_cssattrs.html \
 		test_events_caretmove.html \
 		test_groupattrs.xul \
 	$(warning test_table_indexes.html temporarily disabled) \
 		test_nsIAccessible_actions.html \
 		test_nsIAccessible_actions.xul \
@@ -88,15 +89,14 @@ include $(topsrcdir)/config/rules.mk
 		test_nsIAccessibleTable_4.html \
 		test_nsIAccessibleTable_listboxes.xul \
 		test_nsIAccessNode_utils.html \
 		test_nsOuterDocAccessible.html \
 		test_textattrs.html \
 		test_textboxes.html \
 		test_textboxes.xul \
 		testTextboxes.js \
-		test_bug428479.html \
 		test_bug429285.html \
 		test_bug434464.html \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir)
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -33,16 +33,17 @@ const nsIPropertyElement = Components.in
 
 ////////////////////////////////////////////////////////////////////////////////
 // Roles
 
 const ROLE_COMBOBOX = nsIAccessibleRole.ROLE_COMBOBOX;
 const ROLE_COMBOBOX_LIST = nsIAccessibleRole.ROLE_COMBOBOX_LIST;
 const ROLE_COMBOBOX_OPTION = nsIAccessibleRole.ROLE_COMBOBOX_OPTION;
 const ROLE_DOCUMENT = nsIAccessibleRole.ROLE_DOCUMENT;
+const ROLE_FLAT_EQUATION = nsIAccessibleRole.ROLE_FLAT_EQUATION;
 const ROLE_LABEL = nsIAccessibleRole.ROLE_LABEL;
 const ROLE_LIST = nsIAccessibleRole.ROLE_LIST;
 const ROLE_OPTION = nsIAccessibleRole.ROLE_OPTION;
 const ROLE_TEXT_LEAF = nsIAccessibleRole.ROLE_TEXT_LEAF;
 
 ////////////////////////////////////////////////////////////////////////////////
 // States
 
rename from accessible/tests/mochitest/test_bug428479.html
rename to accessible/tests/mochitest/test_aria_role_equation.html
--- a/accessible/tests/mochitest/test_bug428479.html
+++ b/accessible/tests/mochitest/test_aria_role_equation.html
@@ -2,54 +2,42 @@
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=428479
 -->
 <head>
   <title>ARIA role math chrome tests</title>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
-  <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>
+  <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>
+
+  <script type="application/javascript"
+          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
 
   <script type="application/javascript">
-    function testThis(aID, aAcc)
+    function testThis(aID)
     {
-      is(aAcc.finalRole,
-         Components.interfaces.nsIAccessibleRole.ROLE_FLAT_EQUATION,
-         "Wrong role for " + aID +"!");
-      is(aAcc.name, "x^2 + y^2 + z^2", "Wrong name for " + aID + "!");
+      var eqAcc = getAccessible(aID);
+      if (eqAcc) {
+        is(eqAcc.finalRole, ROLE_FLAT_EQUATION,
+           "Wrong role for " + aID +"!");
+        is(eqAcc.name, "x^2 + y^2 + z^2", "Wrong name for " + aID + "!");
+      }
     }
 
     function doTest()
     {
-      var accRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
-                       getService(Components.interfaces.nsIAccessibleRetrieval);
-
       // Test equation image
-      var imgEqElement = document.getElementById("img_eq");
-      var imgEqAcc;
-      try {
-        imgEqAcc = accRetrieval.getAccessibleFor(imgEqElement);
-      } catch(e) {
-      }
-      ok(imgEqAcc, "no accessible for image equation!");
-      if (imgEqAcc)
-        testThis("img_eq", imgEqAcc);
+      testThis("img_eq");
 
       // Test textual equation
-      var txtEqElement = document.getElementById("txt_eq");
-      var txtEqAcc;
-      try {
-        txtEqAcc = accRetrieval.getAccessibleFor(txtEqElement);
-      } catch(e) {
-      }
-      ok(txtEqAcc, "no accessible for textual equation!");
-      if (txtEqAcc)
-        testThis("txt_eq", txtEqAcc);
+      testThis("txt_eq");
 
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addLoadEvent(doTest);
   </script>
 </head>