Bug 1336335 - avoid potential focus issues by triggering the load of the error page explicitly, r?johannh draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 28 Feb 2017 13:33:36 +0000
changeset 490907 a78b5a95067a97043ee0623edc9b74ec9fe5dc10
parent 490433 1bc2ad020aee2830e0a7941f10958dbec108c254
child 547413 aa59fe50a1b6d35b7b4f5e3c550d5367a9ce003b
push id47266
push usergijskruitbosch@gmail.com
push dateWed, 01 Mar 2017 13:42:14 +0000
reviewersjohannh
bugs1336335
milestone54.0a1
Bug 1336335 - avoid potential focus issues by triggering the load of the error page explicitly, r?johannh MozReview-Commit-ID: 6bqGUMNd4Zj
browser/base/content/test/general/browser_invalid_uri_back_forward_manipulation.js
--- a/browser/base/content/test/general/browser_invalid_uri_back_forward_manipulation.js
+++ b/browser/base/content/test/general/browser_invalid_uri_back_forward_manipulation.js
@@ -5,21 +5,22 @@
  * Verify that loading an invalid URI does not clobber a previously-loaded page's history
  * entry, but that the invalid URI gets its own history entry instead. We're checking this
  * using nsIWebNavigation's canGoBack, as well as actually going back and then checking
  * canGoForward.
  */
 add_task(function* checkBackFromInvalidURI() {
   yield pushPrefs(["keyword.enabled", false]);
   let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:robots", true);
+  info("Loaded about:robots");
+
   gURLBar.value = "::2600";
-  gURLBar.focus();
 
   let promiseErrorPageLoaded = BrowserTestUtils.waitForErrorPage(tab.linkedBrowser);
-  EventUtils.synthesizeKey("VK_RETURN", {});
+  gURLBar.handleCommand();
   yield promiseErrorPageLoaded;
 
   ok(gBrowser.webNavigation.canGoBack, "Should be able to go back");
   if (gBrowser.webNavigation.canGoBack) {
     // Can't use DOMContentLoaded here because the page is bfcached. Can't use pageshow for
     // the error page because it doesn't seem to fire for those.
     let promiseOtherPageLoaded = BrowserTestUtils.waitForEvent(tab.linkedBrowser, "pageshow", false,
       // Be paranoid we *are* actually seeing this other page load, not some kind of race