Bug 919016 - Debugging patch for test_dialogfocus.xul
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 16 Mar 2014 11:08:46 -0400
changeset 191028 5ea145120fc9ba282ae39832bfa75c9440bf429c
parent 191027 550a7a811a30339e4c0a8ac31114560ea7ee8d03
child 191029 d14ffbbfac7b1fc6860e16ed87f224cefd915c53
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs919016
milestone30.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 919016 - Debugging patch for test_dialogfocus.xul
toolkit/content/tests/chrome/test_dialogfocus.xul
--- a/toolkit/content/tests/chrome/test_dialogfocus.xul
+++ b/toolkit/content/tests/chrome/test_dialogfocus.xul
@@ -19,64 +19,73 @@
 <pre id="test">
 </pre>
 </body>
 
 <script>
 <![CDATA[
 
 SimpleTest.waitForExplicitFinish();
+SimpleTest.requestCompleteLog();
 
 var expected = [ "one", "_extra2", "tab", "one", "tabbutton2", "tabbutton", "two", "textbox-yes", "one" ];
 // non-Mac will always focus the default button if any of the dialog buttons
 // would be focused
 if (navigator.platform.indexOf("Mac") == -1)
   expected[1] = "_accept";
 
 var step = 0;
 var fullKeyboardAccess = false;
 
 function startTest()
 {
   var testButton = document.getElementById("test");
   synthesizeKey("VK_TAB", { });
   fullKeyboardAccess = (document.activeElement == testButton);
+  info("We " + (fullKeyboardAccess ? "have" : "don't have") + " full keyboard access");
   runTest();
 }
 
 function runTest()
 {
   step++;
+  info("runTest(), step = " + step + ", expected = " + expected[step - 1]);
   if (step > expected.length || (!fullKeyboardAccess && step == 2)) {
+    info("finishing");
     SimpleTest.finish();
     return;
   }
 
   var expectedFocus = expected[step - 1];
   var win = window.openDialog("dialog_dialogfocus.xul", "_new", "chrome,dialog", step);
 
   function checkDialogFocus(event)
   {
+    info("checkDialogFocus()");
     // if full keyboard access is not on, just skip the tests
     var match = false;
     if (fullKeyboardAccess) {
-      if (!(event.target instanceof Element))
+      if (!(event.target instanceof Element)) {
+        info("target not an Element");
         return;
+      }
 
       if (expectedFocus == "textbox-yes")
         match = (win.document.activeElement == win.document.getElementById(expectedFocus).inputField);
       else if (expectedFocus[0] == "_")
         match = (win.document.activeElement.dlgType == expectedFocus.substring(1));
       else
         match = (win.document.activeElement.id == expectedFocus);
+      info("match = " + match);
       if (!match)
         return;
     }
     else {
       match = (win.document.activeElement == win.document.documentElement);
+      info("match = " + match);
     }
 
     win.removeEventListener("focus", checkDialogFocus, true);
     ok(match, "focus step " + step);
 
     win.close();
     SimpleTest.waitForFocus(runTest, window);
   }