Test for accessing the page info should support new keypress API and not close any browser window
authorHenrik Skupin <hskupin@mozilla.com>
Fri, 29 May 2009 16:07:43 +0200
changeset 28 7a13200ac555
parent 27 caa84fbc2798
child 29 cd92eec8faf6
push idunknown
push userunknown
push dateunknown
Test for accessing the page info should support new keypress API and not close any browser window
firefox/testTechnicalTools/testAccessPageInfoDialog.js
--- a/firefox/testTechnicalTools/testAccessPageInfoDialog.js
+++ b/firefox/testTechnicalTools/testAccessPageInfoDialog.js
@@ -64,35 +64,27 @@ var testAccessPageInfo = function () {
   // Load web page with RSS feed
   controller.open('http://www.cnn.com');
   controller.waitForPageLoad(controller.tabs.activeTab);
 
   // Open context menu on the html element and select Page Info entry
   controller.rightclick(new elementslib.XPath(controller.tabs.activeTab, "/html"));
   controller.sleep(gDelay);
   controller.click(new elementslib.ID(controller.window.document, "context-viewinfo"));
-  controller.sleep(gDelay);
+  controller.sleep(500);
 
-  // Check if the Page Info window has been opened and is in the foreground
-  var window = mozmill.wm.getMostRecentWindow('');
-  if (window &&
-      window.document.documentElement.getAttribute('windowtype') != 'Browser:page-info') {
-    window.close();
-    throw "Page info window not in foreground";
-  }
-
-  // Create controller for checking all tabs
+  // Check if the Page Info window has been opened
+  var window = mozmill.wm.getMostRecentWindow('Browser:page-info');
   var piController = new mozmill.controller.MozMillController(window);
 
   // Step through each of the tabs
   for each (pane in panes) {
     piController.click(new elementslib.ID(piController.window.document, pane.button));
     piController.sleep(gDelay);
 
     // Check if the panel has been shown
     var node = new elementslib.ID(piController.window.document, pane.panel);
     utils.delayedAssertNode(piController, node);
   }
 
-  // Close the Page Info window by pressing ESC
-  var deck = new elementslib.ID(piController.window.document, "mainDeck");
-  piController.keypress(deck, 27, false, false, false, false);
+  // Close the Page Info window by pressing Escape
+  piController.keypress(null, 'VK_ESCAPE', {});
 }