bug 462316 - Refactor test_aria_role_article.html, r=surkov
authorMarco Zehe <marco.zehe@googlemail.com>
Thu, 30 Oct 2008 11:47:16 +0100
changeset 21096 443f9092eba5a61071bf072aad7b044c5f8c42f6
parent 21095 1ac20b494c0f8e5a133919160130165450bcceca
child 21097 b9dd40cbf22d661fa87b32dbbcd209963d22e023
push id3308
push usermzehe@mozilla.com
push dateThu, 30 Oct 2008 10:47:40 +0000
treeherdermozilla-central@443f9092eba5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs462316
milestone1.9.1b2pre
bug 462316 - Refactor test_aria_role_article.html, r=surkov
accessible/tests/mochitest/common.js
accessible/tests/mochitest/test_aria_role_article.html
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -32,16 +32,17 @@ const nsIDOMNode = Components.interfaces
 const nsIPropertyElement = Components.interfaces.nsIPropertyElement;
 
 ////////////////////////////////////////////////////////////////////////////////
 // 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_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
 
--- a/accessible/tests/mochitest/test_aria_role_article.html
+++ b/accessible/tests/mochitest/test_aria_role_article.html
@@ -1,51 +1,47 @@
-<!DOCTYPE html>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=429666
--->
-<head>
-  <title>Expose ROLE_DOCUMENT for ARIA landmarks that inherit from document 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">
-    function doTest()
-    {
-      var accRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
-                       getService(Components.interfaces.nsIAccessibleRetrieval);
-
-      // Test article exposed as document
-      var articleElement = document.getElementById("testArticle");
-      var articleAcc = null;
-      try {
-        articleAcc = accRetrieval.getAccessibleFor(articleElement);
-      } catch(e) { }
-      ok(articleAcc, "no accessible for article!");
-      if (articleAcc) {
-        is(articleAcc.finalRole,
-           Components.interfaces.nsIAccessibleRole.ROLE_DOCUMENT,
-           "Wrong role for article!");
-        is(articleAcc.name, "Test article", "Wrong name for article!");
-      }
-
-      SimpleTest.finish();
-    }
-
-    SimpleTest.waitForExplicitFinish();
-    addLoadEvent(doTest);
-  </script>
-</head>
-<body>
-
-  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=429666">Mozilla Bug 429666</a>
-  <p id="display"></p>
-  <div id="content" style="display: none"></div>
-  <pre id="test">
-  </pre>
-  <div id="testArticle" role="article" title="Test article">
-    <p>This is a paragraph inside the article.</p>
-  </div>
-</body>
-</html>
+<!DOCTYPE html>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=429666
+-->
+<head>
+  <title>Expose ROLE_DOCUMENT for ARIA landmarks that inherit from document 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/a11y/accessible/common.js"></script>
+
+  <script type="application/javascript">
+    function doTest()
+    {
+      // Test article exposed as document
+      var articleAcc = getAccessible("testArticle");
+      if (articleAcc) {
+        is(articleAcc.finalRole, ROLE_DOCUMENT,
+           "Wrong role for article!");
+        is(articleAcc.name, "Test article", "Wrong name for article!");
+      }
+
+      SimpleTest.finish();
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    addLoadEvent(doTest);
+  </script>
+</head>
+<body>
+
+  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=429666">Mozilla Bug 429666</a>
+  <p id="display"></p>
+  <div id="content" style="display: none"></div>
+  <pre id="test">
+  </pre>
+  <div id="testArticle" role="article" title="Test article">
+    <p>This is a paragraph inside the article.</p>
+  </div>
+</body>
+</html>