Bug 1179542 - Wait for the page to load before checking menu status. r=ehsan, a=test-only
authorMichael Layzell <michael@thelayzells.com>
Fri, 10 Mar 2017 12:20:26 -0500
changeset 379052 22cf7e91401979924fd3214df228e64f8bd4f0b1
parent 379051 5359d7b1d4cdb6807595d21d8b233f58ec5dd84b
child 379053 df89e9e6d301c618c0dfb3dcb8093637ca717200
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, test-only
bugs1179542
milestone53.0
Bug 1179542 - Wait for the page to load before checking menu status. r=ehsan, a=test-only MozReview-Commit-ID: 7wHbkAC8eCI
toolkit/content/tests/browser/browser_bug1170531.js
--- a/toolkit/content/tests/browser/browser_bug1170531.js
+++ b/toolkit/content/tests/browser/browser_bug1170531.js
@@ -41,36 +41,39 @@ add_task(function* () {
       editMenu.open = true;
     });
   };
 
   yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, function* (browser) {
     let menu_cut_disabled, menu_copy_disabled;
 
     yield BrowserTestUtils.loadURI(browser, "data:text/html,<div>hello!</div>");
+    yield BrowserTestUtils.browserLoaded(browser);
     browser.focus();
     yield new Promise(resolve => waitForFocus(resolve, window));
     yield new Promise(openMenu);
     menu_cut_disabled = menuPopup.querySelector("#menu_cut").getAttribute("disabled") == "true";
     is(menu_cut_disabled, false, "menu_cut should be enabled");
     menu_copy_disabled = menuPopup.querySelector("#menu_copy").getAttribute("disabled") == "true";
     is(menu_copy_disabled, false, "menu_copy should be enabled");
     yield new Promise(closeMenu);
 
     yield BrowserTestUtils.loadURI(browser, "data:text/html,<div contentEditable='true'>hello!</div>");
+    yield BrowserTestUtils.browserLoaded(browser);
     browser.focus();
     yield new Promise(resolve => waitForFocus(resolve, window));
     yield new Promise(openMenu);
     menu_cut_disabled = menuPopup.querySelector("#menu_cut").getAttribute("disabled") == "true";
     is(menu_cut_disabled, false, "menu_cut should be enabled");
     menu_copy_disabled = menuPopup.querySelector("#menu_copy").getAttribute("disabled") == "true";
     is(menu_copy_disabled, false, "menu_copy should be enabled");
     yield new Promise(closeMenu);
 
     yield BrowserTestUtils.loadURI(browser, "about:preferences");
+    yield BrowserTestUtils.browserLoaded(browser);
     browser.focus();
     yield new Promise(resolve => waitForFocus(resolve, window));
     yield new Promise(openMenu);
     menu_cut_disabled = menuPopup.querySelector("#menu_cut").getAttribute("disabled") == "true";
     is(menu_cut_disabled, true, "menu_cut should be disabled");
     menu_copy_disabled = menuPopup.querySelector("#menu_copy").getAttribute("disabled") == "true";
     is(menu_copy_disabled, true, "menu_copy should be disabled");
     yield new Promise(closeMenu);