Bug 605365 - Use waitForFirstPaint() in content popup test (r=mfinkle)
authorLucas Rocha <lucasr@mozilla.com>
Mon, 19 Sep 2011 09:46:28 -0700
changeset 77141 1006e859c44b1d074ea853784ab206e4ea279a2f
parent 77140 b37d37febea9b1c303d979c5c990ba7f1e386412
child 77142 ea2f892d94391494c13e907c1128a6ca9826d582
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmfinkle
bugs605365
milestone9.0a1
Bug 605365 - Use waitForFirstPaint() in content popup test (r=mfinkle)
mobile/chrome/tests/browser_contentpopup.js
--- a/mobile/chrome/tests/browser_contentpopup.js
+++ b/mobile/chrome/tests/browser_contentpopup.js
@@ -15,24 +15,19 @@ function test() {
   messageManager.addMessageListener("pageshow", function(aMessage) {
     if (newTab && newTab.browser.currentURI.spec != "about:blank") {
       messageManager.removeMessageListener(aMessage.name, arguments.callee);
       BrowserUI.closeAutoComplete(true);
       setTimeout(runNextTest, 0);
     }
   });
 
-  let startupInfo = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup).getStartupInfo();
-  if (!("firstPaint" in startupInfo))
-    waitFor(function() { newTab = Browser.addTab(testURL, true); }, function() {
-      let startupInfo = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup).getStartupInfo();
-      return ("firstPaint" in startupInfo);
-    }, Date.now() + 3000);
-  else
+  waitForFirstPaint(function() {
     newTab = Browser.addTab(testURL, true);
+  });
 }
 
 //------------------------------------------------------------------------------
 // Iterating tests by shifting test out one by one as runNextTest is called.
 function runNextTest() {
   // Run the next test until all tests completed
   if (gTests.length > 0) {
     gCurrentTest = gTests.shift();