fune/browser/base/content/test/urlbar/browser_autocomplete_cursor.js
Marco Bonardo a56b06b012 Bug 1299428 - Use more of BrowserTestUtils in urlbar tests. r=adw
MozReview-Commit-ID: DnM6PylbNv

--HG--
extra : rebase_source : c5546272d80ace66d3347000cd8fd3691792ec49
2016-10-31 17:56:01 +01:00

17 lines
590 B
JavaScript

add_task(function*() {
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:mozilla");
yield promiseAutocompleteResultPopup("www.mozilla.org");
gURLBar.selectTextRange(4, 4);
is(gURLBar.popup.state, "open", "Popup should be open");
is(gURLBar.popup.richlistbox.selectedIndex, 0, "Should have selected something");
EventUtils.synthesizeKey("VK_RIGHT", {});
yield promisePopupHidden(gURLBar.popup);
is(gURLBar.selectionStart, 5, "Should have moved the cursor");
is(gURLBar.selectionEnd, 5, "And not selected anything");
gBrowser.removeTab(tab);
});