|
1 function test() { |
|
2 waitForExplicitFinish(); |
|
3 |
|
4 let tab = gBrowser.addTab("http://example.com"); |
|
5 gBrowser.selectedTab = tab; |
|
6 |
|
7 onLoad(function () { |
|
8 let originalValue = gURLBar.value; |
|
9 |
|
10 gBrowser.userTypedValue = "foobar"; |
|
11 gBrowser.selectedTab = gBrowser.tabs[0]; |
|
12 gBrowser.selectedTab = tab; |
|
13 is(gURLBar.value, "foobar", "location bar displays typed value"); |
|
14 |
|
15 gURLBar.focus(); |
|
16 EventUtils.synthesizeKey("VK_ESCAPE", {}); |
|
17 is(gURLBar.value, originalValue, "ESC reverted the location bar value"); |
|
18 |
|
19 gBrowser.removeTab(tab); |
|
20 finish(); |
|
21 }); |
|
22 } |
|
23 |
|
24 function onLoad(callback) { |
|
25 gBrowser.selectedBrowser.addEventListener("pageshow", function loadListener() { |
|
26 gBrowser.selectedBrowser.removeEventListener("pageshow", loadListener, false); |
|
27 executeSoon(callback); |
|
28 }); |
|
29 } |