Bug 609931 - browser_awesomescreen.js test is timing out [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Fri, 05 Nov 2010 18:49:35 +0100
changeset 66970 699a2e58da96f8f9a6e64fe93f2ffb811d25b1a1
parent 66969 37b95b834e9482a1b27230a75b95125d21b3fee0
child 66971 65f69c611234fd8a9033ebf418fc7f703785d687
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs609931
Bug 609931 - browser_awesomescreen.js test is timing out [r=mfinkle]
mobile/chrome/tests/browser_awesomescreen.js
--- a/mobile/chrome/tests/browser_awesomescreen.js
+++ b/mobile/chrome/tests/browser_awesomescreen.js
@@ -23,25 +23,26 @@ function test() {
 function runNextTest() {
   // Run the next test until all tests completed
   if (gTests.length > 0) {
     gCurrentTest = gTests.shift();
     info(gCurrentTest.desc);
     gCurrentTest.run();
   }
   else {
-    BrowserUI.closeAutoComplete();
+    // Close the awesome panel just in case
+    BrowserUI.activePanel = null;
     finish();
   }
 }
 
 //------------------------------------------------------------------------------
-// Case: Test awesome bar open attribute
+// Case: Test awesome bar collapsed state
 gTests.push({
-  desc: "Test awesome bar open attribute",
+  desc: "Test awesome bar collapsed state",
 
   run: function() {
     window.addEventListener("NavigationPanelShown", function(aEvent) {
       window.removeEventListener(aEvent.type, arguments.callee, false);
       gCurrentTest.onPopupShown();
     }, false);
 
     AllPagesList.doCommand();
@@ -86,16 +87,19 @@ gTests.push({
 
   onPopupReady: function() {
     is(BrowserUI.activePanel == AllPagesList, true, "AllPagesList should be visible");
 
     let awesomeHeader = document.getElementById("awesome-header");
     is(awesomeHeader.hidden, false, "Awesome header should be visible");
 
     BrowserUI._edit.addEventListener("onsearchbegin", function(aEvent) {
+      if (BrowserUI._edit.value == "")
+        return;
+
       BrowserUI._edit.removeEventListener(aEvent.type, arguments.callee, true);
       let awesomeHeader = document.getElementById("awesome-header");
       is(awesomeHeader.hidden, true, "Awesome header should be hidden");
       gCurrentTest.onKeyPress();
     }, true);
     EventUtils.synthesizeKey("A", {}, window);
   },