Bug 960999 - Fix for random test failure in browser_form_selects.js. r=mbrubeck, a=test-only
authorJim Mathies <jmathies@mozilla.com>
Fri, 17 Jan 2014 17:44:40 -0600
changeset 175270 ef7302e61fe7fccf33a464b451d223b29066214c
parent 175269 26dc19b5392e0cdde6b4fe2522eb1d15eee91fb7
child 175271 bb8ad829ddaec0ac80eb400884aa22367add8b5b
push id3238
push userryanvm@gmail.com
push dateSun, 09 Feb 2014 20:48:21 +0000
treeherdermozilla-beta@bb8ad829ddae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck, test-only
bugs960999
milestone28.0
Bug 960999 - Fix for random test failure in browser_form_selects.js. r=mbrubeck, a=test-only
browser/metro/base/tests/mochitest/browser_form_selects.js
--- a/browser/metro/base/tests/mochitest/browser_form_selects.js
+++ b/browser/metro/base/tests/mochitest/browser_form_selects.js
@@ -30,17 +30,19 @@ gTests.push({
     sendNativeTap(select);
     yield promise;
 
     // tap every option
     for (let node of SelectHelperUI._listbox.childNodes) {
       sendNativeTap(node);
     }
 
-    yield waitForMs(100);
+    yield waitForCondition2(function () {
+      return Browser.selectedTab.browser.contentWindow.document.getElementById("opt9").selected;
+      }, "waiting for last option to select");
 
     // check the menu state
     for (let node of SelectHelperUI._listbox.childNodes) {
       ok(node.selected, "option is selected");
     }
 
     // check the underlying form state
     for (let index = 1; index < 10; index++) {
@@ -48,17 +50,19 @@ gTests.push({
       ok(option.selected, "opt" + index + " form option selected");
     }
 
     // tap every option again
     for (let node of SelectHelperUI._listbox.childNodes) {
       sendNativeTap(node);
     }
 
-    yield waitForMs(100);
+    yield waitForCondition2(function () {
+      return !Browser.selectedTab.browser.contentWindow.document.getElementById("opt9").selected;
+      }, "waiting for last option to deselect");
 
     // check the menu state
     for (let node of SelectHelperUI._listbox.childNodes) {
       ok(!node.selected, "option is not selected");
     }
 
     // check the underlying form state
     for (let index = 1; index < 10; index++) {