fune/browser/base/content/test/urlbar/browser_autocomplete_cursor.js
Marco Bonardo 944f20e73f Bug 1467537 - The delete trigger on moz_updateoriginsinsert_temp is recalculating the whole table every time. r=adw
The trigger is missing a WHERE clause, and as such it ends up doing a lot more work than necessary.

The nsAutoCompleteController changes cover a bug where VK_RIGHT autofills when it's not necessary,
and by doing that it will move the caret to an unexpected position (far right) even if it didn't
actually complete some preselected text.

MozReview-Commit-ID: 1mVbxCdqVSr

--HG--
extra : rebase_source : 9a7e13cc62dfe0ae95210e7a75068d07a0b7c275
2018-06-08 11:31:13 +02:00

21 lines
754 B
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
add_task(async function() {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:mozilla");
await promiseAutocompleteResultPopup("www.mozilla.org");
await waitForAutocompleteResultAt(0);
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("KEY_ArrowRight");
await promisePopupHidden(gURLBar.popup);
is(gURLBar.selectionStart, 5, "Should have moved the cursor");
is(gURLBar.selectionEnd, 5, "And not selected anything");
BrowserTestUtils.removeTab(tab);
});