Bug 872338 - Update pivot tests to reflect virtualCursor in every doc change. r=tbsaunde
authorEitan Isaacson <eitan@monotonous.org>
Fri, 17 May 2013 19:10:30 -0700
changeset 132341 9178f40ffa6395e6663b512529a6194df6bbcd0f
parent 132340 5e792395df360e121d5ab4bf3e2612e694609f98
child 132342 82a243758a1d5bb78e9861656e21662f1a638291
push id28218
push userphilringnalda@gmail.com
push dateSun, 19 May 2013 01:40:12 +0000
treeherdermozilla-inbound@9178f40ffa63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs872338
milestone24.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 872338 - Update pivot tests to reflect virtualCursor in every doc change. r=tbsaunde
accessible/tests/mochitest/pivot/test_virtualcursor.html
--- a/accessible/tests/mochitest/pivot/test_virtualcursor.html
+++ b/accessible/tests/mochitest/pivot/test_virtualcursor.html
@@ -21,37 +21,27 @@
   <script type="application/javascript" src="../layout.js"></script>
 
   <script type="application/javascript">
     var gBrowserWnd = null;
     var gQueue = null;
 
     function doTest()
     {
-      var rootAcc = getRootAccessible(browserWindow().document);
-      try {
-        rootAcc.QueryInterface(nsIAccessibleCursorable);
-      } catch (e) {
-        ok(false, "Root accessible does not support nsIAccessibleCursorable");
-      }
-      var doc = currentTabDocument();
-      var docAcc = getAccessible(doc, [nsIAccessibleDocument,
-                                       nsIAccessibleCursorable]);
+      var rootAcc = getAccessible(browserDocument(), [nsIAccessibleDocument]);
+      ok(rootAcc.virtualCursor,
+         "root document does not have virtualCursor");
 
-      // Test that embedded documents don't have their own virtual cursor.
+      var doc = currentTabDocument();
+      var docAcc = getAccessible(doc, [nsIAccessibleDocument]);
+
+      // Test that embedded documents have their own virtual cursor.
       is(docAcc.childDocumentCount, 1, "Expecting one child document");
-      var childDoc = docAcc.getChildDocumentAt(0);
-      var supportsVC = true;
-      try {
-        childDoc.QueryInterface(nsIAccessibleCursorable);
-      } catch (e) {
-        supportsVC = false;
-      }
-
-      ok(!supportsVC, "no nsIAccessibleCursorable support in child document");
+      ok(docAcc.getChildDocumentAt(0).virtualCursor,
+         "child document does not have virtualCursor");
 
       gQueue = new eventQueue();
 
       gQueue.onFinish = function onFinish()
       {
         closeBrowserWindow();
       }