gecko-dev/browser/base/content/test/urlbar/browser_urlbarUpdateForDomainCompletion.js
Gijs Kruitbosch 1d863b1c09 Bug 1267289 - add more URL bar tests and fix issue with error pages, r=mikedeboer,mconley
This adds tests for issues brought up in bug 231393, bug 264610, bug 302575 and bug 1129564,
all of which fed into the current implementation of userTypedClear/userTypedValue. I intend
to move us away from userTypedClear, but I'm keen not to regress any of these issues, so
I'm adding automated tests to ensure that doesn't happen.

MozReview-Commit-ID: 1up2MIXzkzG

--HG--
extra : rebase_source : 4d37f13895b8c7e7aba5331664718582c6b2136c
2016-04-25 17:27:35 +01:00

17 lines
690 B
JavaScript

"use strict";
/**
* Disable keyword.enabled (so no keyword search), and check that when you type in
* "example" and hit enter, the browser loads and the URL bar is updated accordingly.
*/
add_task(function* () {
yield new Promise(resolve => SpecialPowers.pushPrefEnv({set: [["keyword.enabled", false]]}, resolve));
yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, function* (browser) {
gURLBar.value = "example";
gURLBar.select();
let loadPromise = BrowserTestUtils.browserLoaded(browser, false, url => url == "http://www.example.com/");
EventUtils.sendKey("return");
yield loadPromise;
is(gURLBar.textValue, "www.example.com");
});
});