Loading browser/base/content/test/general/browser.ini +1 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,7 @@ skip-if = e10s # Bug 1093153 - no about:home support yet [browser_autocomplete_a11y_label.js] skip-if = e10s # Bug 1101993 - times out for unknown reasons when run in the dir (works on its own) [browser_autocomplete_cursor.js] [browser_autocomplete_edit_completed.js] [browser_autocomplete_enter_race.js] [browser_autocomplete_no_title.js] [browser_autocomplete_autoselect.js] Loading browser/base/content/test/general/browser_autocomplete_edit_completed.js 0 → 100644 +53 −0 Original line number Diff line number Diff line add_task(function*() { yield PlacesTestUtils.clearHistory(); yield PlacesTestUtils.addVisits([ { uri: makeURI("http://example.com/foo") }, { uri: makeURI("http://example.com/foo/bar") }, ]); Services.prefs.setBoolPref("browser.urlbar.unifiedcomplete", true); yield* do_test(); Services.prefs.setBoolPref("browser.urlbar.unifiedcomplete", false); yield* do_test(); }); registerCleanupFunction(function* () { Services.prefs.clearUserPref("browser.urlbar.unifiedcomplete"); yield PlacesTestUtils.clearHistory(); }); function* do_test() { gBrowser.selectedTab = gBrowser.addTab("about:blank"); gURLBar.focus(); yield promiseAutocompleteResultPopup("http://example.com"); let popup = gURLBar.popup; let list = popup.richlistbox; let initialIndex = list.selectedIndex; info("Key Down to select the next item."); EventUtils.synthesizeKey("VK_DOWN", {}); let nextIndex = initialIndex + 1; let nextValue = gURLBar.controller.getFinalCompleteValueAt(nextIndex); is(list.selectedIndex, nextIndex, "The next item is selected."); is(gURLBar.value, nextValue, "The selected URL is completed."); info("Press backspace"); EventUtils.synthesizeKey("VK_BACK_SPACE", {}); yield promiseSearchComplete(); let editedValue = gURLBar.value; is(list.selectedIndex, initialIndex, "The initial index is selected again."); isnot(editedValue, nextValue, "The URL has changed."); info("Press return to load edited URL."); EventUtils.synthesizeKey("VK_RETURN", {}); yield Promise.all([ promisePopupHidden(gURLBar.popup), waitForDocLoadAndStopIt("http://" + editedValue)]); gBrowser.removeTab(gBrowser.selectedTab); } toolkit/components/autocomplete/nsAutoCompleteController.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -1344,7 +1344,9 @@ nsAutoCompleteController::EnterMatch(bool aIsPopupSelection) GetResultValueAt(mCompletedSelectionIndex, true, finalValue); nsAutoString inputValue; input->GetTextValue(inputValue); if (!finalValue.Equals(inputValue)) { nsAutoString completedValue; GetResultValueAt(mCompletedSelectionIndex, false, completedValue); if (completedValue.Equals(inputValue) && !finalValue.Equals(inputValue)) { value = finalValue; } // Note that if the user opens the popup, mouses over entries without Loading Loading
browser/base/content/test/general/browser.ini +1 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,7 @@ skip-if = e10s # Bug 1093153 - no about:home support yet [browser_autocomplete_a11y_label.js] skip-if = e10s # Bug 1101993 - times out for unknown reasons when run in the dir (works on its own) [browser_autocomplete_cursor.js] [browser_autocomplete_edit_completed.js] [browser_autocomplete_enter_race.js] [browser_autocomplete_no_title.js] [browser_autocomplete_autoselect.js] Loading
browser/base/content/test/general/browser_autocomplete_edit_completed.js 0 → 100644 +53 −0 Original line number Diff line number Diff line add_task(function*() { yield PlacesTestUtils.clearHistory(); yield PlacesTestUtils.addVisits([ { uri: makeURI("http://example.com/foo") }, { uri: makeURI("http://example.com/foo/bar") }, ]); Services.prefs.setBoolPref("browser.urlbar.unifiedcomplete", true); yield* do_test(); Services.prefs.setBoolPref("browser.urlbar.unifiedcomplete", false); yield* do_test(); }); registerCleanupFunction(function* () { Services.prefs.clearUserPref("browser.urlbar.unifiedcomplete"); yield PlacesTestUtils.clearHistory(); }); function* do_test() { gBrowser.selectedTab = gBrowser.addTab("about:blank"); gURLBar.focus(); yield promiseAutocompleteResultPopup("http://example.com"); let popup = gURLBar.popup; let list = popup.richlistbox; let initialIndex = list.selectedIndex; info("Key Down to select the next item."); EventUtils.synthesizeKey("VK_DOWN", {}); let nextIndex = initialIndex + 1; let nextValue = gURLBar.controller.getFinalCompleteValueAt(nextIndex); is(list.selectedIndex, nextIndex, "The next item is selected."); is(gURLBar.value, nextValue, "The selected URL is completed."); info("Press backspace"); EventUtils.synthesizeKey("VK_BACK_SPACE", {}); yield promiseSearchComplete(); let editedValue = gURLBar.value; is(list.selectedIndex, initialIndex, "The initial index is selected again."); isnot(editedValue, nextValue, "The URL has changed."); info("Press return to load edited URL."); EventUtils.synthesizeKey("VK_RETURN", {}); yield Promise.all([ promisePopupHidden(gURLBar.popup), waitForDocLoadAndStopIt("http://" + editedValue)]); gBrowser.removeTab(gBrowser.selectedTab); }
toolkit/components/autocomplete/nsAutoCompleteController.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -1344,7 +1344,9 @@ nsAutoCompleteController::EnterMatch(bool aIsPopupSelection) GetResultValueAt(mCompletedSelectionIndex, true, finalValue); nsAutoString inputValue; input->GetTextValue(inputValue); if (!finalValue.Equals(inputValue)) { nsAutoString completedValue; GetResultValueAt(mCompletedSelectionIndex, false, completedValue); if (completedValue.Equals(inputValue) && !finalValue.Equals(inputValue)) { value = finalValue; } // Note that if the user opens the popup, mouses over entries without Loading