Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 function test() {
2 waitForExplicitFinish();
4 let tab = gBrowser.addTab("http://example.com");
5 gBrowser.selectedTab = tab;
7 onLoad(function () {
8 let originalValue = gURLBar.value;
10 gBrowser.userTypedValue = "foobar";
11 gBrowser.selectedTab = gBrowser.tabs[0];
12 gBrowser.selectedTab = tab;
13 is(gURLBar.value, "foobar", "location bar displays typed value");
15 gURLBar.focus();
16 EventUtils.synthesizeKey("VK_ESCAPE", {});
17 is(gURLBar.value, originalValue, "ESC reverted the location bar value");
19 gBrowser.removeTab(tab);
20 finish();
21 });
22 }
24 function onLoad(callback) {
25 gBrowser.selectedBrowser.addEventListener("pageshow", function loadListener() {
26 gBrowser.selectedBrowser.removeEventListener("pageshow", loadListener, false);
27 executeSoon(callback);
28 });
29 }