TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/mobile/chrome/browser_preferences_basic.js | Preferences pane is panned up - Got 0 0, expected 0,101 [r=me]
authorVivien Nicolas <21@vingtetun.org>
Wed, 05 Jan 2011 18:08:07 +0100
changeset 67213 5952fe392721b58d83399679ea5b85de42286e4a
parent 67212 c4fd88f424c58eb9bd9cf40c28435698818f2c1b
child 67214 180fb716ea4b90704d851e65a301afa8d1b21c4c
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)
reviewersme
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/mobile/chrome/browser_preferences_basic.js | Preferences pane is panned up - Got 0 0, expected 0,101 [r=me]
mobile/chrome/tests/browser_preferences_basic.js
--- a/mobile/chrome/tests/browser_preferences_basic.js
+++ b/mobile/chrome/tests/browser_preferences_basic.js
@@ -146,34 +146,38 @@ gTests.push({
     gCurrentTest._prefsScrollbox.getPosition(x, y);
     ok((x.value == 0 && y.value ==0 ), "Preferences pane is not panned right", "Got " + x.value + " " + y.value + ", expected 0,0");
 
     // Move preferences pane up
     let [x1, y1, x2, y2] = [w / 2, h / 2, w / 2, h / 4].map(Math.round);
     EventUtils.synthesizeMouse(prefsList, x1, y1, { type: "mousedown" });
     EventUtils.synthesizeMouse(prefsList, x2, y2, { type: "mousemove" });
 
-    // Check whether it is moved up to the correct view
-    let distance = y1 - y2;
-    gCurrentTest._prefsScrollbox.getPosition(x, y);
-    ok((x.value == 0 && y.value == distance), "Preferences pane is panned up", "Got " + x.value + " " + y.value + ", expected 0," + distance);
-
     // Need to wait for a paint event before another
     window.addEventListener("MozAfterPaint", function(aEvent) {
       window.removeEventListener("MozAfterPaint", arguments.callee, false);
+      // Check whether it is moved up to the correct view
+      let distance = y1 - y2;
+      gCurrentTest._prefsScrollbox.getPosition(x, y);
+      ok((x.value == 0 && y.value == distance), "Preferences pane is panned up", "Got " + x.value + " " + y.value + ", expected 0," + distance);
 
-      // Move preferences pane down
-      EventUtils.synthesizeMouse(prefsList, x1, y1, { type: "mousemove" });
-      EventUtils.synthesizeMouse(prefsList, x1, y1, { type: "mouseup" });
+      // Need to wait for a paint event before another
+      window.addEventListener("MozAfterPaint", function(aEvent) {
+        window.removeEventListener("MozAfterPaint", arguments.callee, false);
 
-      // Check whether it goes back to old position
-      gCurrentTest._prefsScrollbox.getPosition(x, y);
-      ok((x.value == 0 && y.value == 0), "Preferences pane is panned down", "Got " + x.value + " " + y.value + ", expected 0,0");
+        // Move preferences pane down
+        EventUtils.synthesizeMouse(prefsList, x1, y1, { type: "mousemove" });
+        EventUtils.synthesizeMouse(prefsList, x1, y1, { type: "mouseup" });
 
-      gCurrentTest.finish();
+        // Check whether it goes back to old position
+        gCurrentTest._prefsScrollbox.getPosition(x, y);
+        ok((x.value == 0 && y.value == 0), "Preferences pane is panned down", "Got " + x.value + " " + y.value + ", expected 0,0");
+
+        gCurrentTest.finish();
+      }, false);
     }, false);
   },
 
   finish: function() {
     // Close the preferences pane
     BrowserUI.hidePanel();
 
     // check whether the preferences pane has disappeared