Bug 849399. Adjust test timeouts to account for newly correct behaviour in nsTransitionManager.cpp. r=dbaron
authorNicholas Cameron <ncameron@mozilla.com>
Tue, 18 Jun 2013 14:18:55 +1200
changeset 146886 ed83ea2963822ebe44034456f4ec62bba2f41556
parent 146885 928202d898e77685aa8d50315790077d3f789dff
child 146887 4bf28d2bed42b77a07dd137659087baf10c7df73
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs849399
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 849399. Adjust test timeouts to account for newly correct behaviour in nsTransitionManager.cpp. r=dbaron
toolkit/content/tests/chrome/bug451286_window.xul
--- a/toolkit/content/tests/chrome/bug451286_window.xul
+++ b/toolkit/content/tests/chrome/bug451286_window.xul
@@ -17,16 +17,20 @@
     const Ci = Components.interfaces;
     const Cc = Components.classes;
     const Cr = Components.results;
     const SEARCH_TEXT = "text";
     const DATAURI = "data:text/html," + SEARCH_TEXT;
 
     var gFindBar = null;
     var gBrowser;
+    var gWin;
+
+    var noHighlightSnapshot;
+    var findSnapshot;
 
     var imports = ["SimpleTest", "ok", "snapshotWindow", "compareSnapshots",
                    "parentFinish"];
     for each (var name in imports) {
       window[name] = window.opener.wrappedJSObject[name];
     }
 
     function finish() {
@@ -55,37 +59,52 @@
       // Don't respond to pageshow events coming from the <iframes>
       if (aEvent.target != gBrowser.contentDocument)
         return;
 
       gBrowser.removeEventListener("pageshow", onPageShow, false);
 
       // First, take a snapshot of the window without highlighting
       // to be used later to test the unhighlighting case
-      var gWin = gBrowser.contentWindow;
-      var noHighlightSnapshot = snapshotWindow(gWin);
+      gWin = gBrowser.contentWindow;
+      noHighlightSnapshot = snapshotWindow(gWin);
 
       gFindBar.open();
       gFindBar._findField.value = SEARCH_TEXT;
       var matchCase = gFindBar.getElement("find-case-sensitive");
       if (matchCase.checked)
         matchCase.doCommand();
 
       // Turn on highlighting
       gFindBar.toggleHighlight(true);
       gFindBar.close();
-    
+      gFindBar.addEventListener('transitionend', part2);
+    }
+
+    function part2(aEvent) {
+      if (aEvent.propertyName != 'visibility') {
+        return;
+      }
+      gFindBar.removeEventListener('transitionend', part2);
       // Take snapshot of highlighing
-      var findSnapshot = snapshotWindow(gWin);
+      findSnapshot = snapshotWindow(gWin);
 
       // Now, remove the highlighting, and take a snapshot to compare
       // to our original state
       gFindBar.open();
       gFindBar.toggleHighlight(false);
       gFindBar.close();
+      gFindBar.addEventListener('transitionend', part3);
+    }
+
+    function part3(aEvent) {
+      if (aEvent.propertyName != 'visibility') {
+        return;
+      }
+      gFindBar.removeEventListener('transitionend', part3);
       var unhighlightSnapshot = snapshotWindow(gWin);
 
       // Select the matches that should have been highlighted manually
       var doc = gBrowser.contentDocument;
 
       // Create a manual highlight in the visible iframe to test bug 451286
       var iframe = doc.getElementById("visible");
       var ifBody = iframe.contentDocument.body;