зеркало из https://github.com/mozilla/gecko-dev.git
Bug 962652 - Autocomplete popup's isOpen getter is too strict, r=msucan
This commit is contained in:
Родитель
60d58aad6a
Коммит
68dc41254c
|
@ -89,8 +89,7 @@ function test()
|
|||
inspector.searchSuggestions._lastQuery.then(() => {
|
||||
let [key, suggestions] = keyStates[state];
|
||||
let actualSuggestions = popup.getItems();
|
||||
is(popup._panel.state == "open" || popup._panel.state == "showing"
|
||||
? actualSuggestions.length: 0, suggestions.length,
|
||||
is(popup.isOpen ? actualSuggestions.length: 0, suggestions.length,
|
||||
"There are expected number of suggestions at " + state + "th step.");
|
||||
actualSuggestions = actualSuggestions.reverse();
|
||||
for (let i = 0; i < suggestions.length; i++) {
|
||||
|
|
|
@ -90,8 +90,7 @@ function test()
|
|||
inspector.searchSuggestions._lastQuery.then(() => {
|
||||
let [key, suggestions] = keyStates[state];
|
||||
let actualSuggestions = popup.getItems();
|
||||
is(popup._panel.state == "open" || popup._panel.state == "showing"
|
||||
? actualSuggestions.length: 0, suggestions.length,
|
||||
is(popup.isOpen ? actualSuggestions.length: 0, suggestions.length,
|
||||
"There are expected number of suggestions at " + state + "th step.");
|
||||
actualSuggestions = actualSuggestions.reverse();
|
||||
for (let i = 0; i < suggestions.length; i++) {
|
||||
|
|
|
@ -130,9 +130,7 @@ function test() {
|
|||
is(editor.input.selectionEnd, selEnd,
|
||||
"Selection is ending at the right location for state " + state);
|
||||
if (popupOpen) {
|
||||
ok(editor.popup._panel.state == "open" ||
|
||||
editor.popup._panel.state == "showing",
|
||||
"Popup is open for state " + state);
|
||||
ok(editor.popup.isOpen, "Popup is open for state " + state);
|
||||
}
|
||||
else {
|
||||
ok(editor.popup._panel.state != "open" &&
|
||||
|
|
|
@ -159,7 +159,7 @@ AutocompletePopup.prototype = {
|
|||
* Check if the autocomplete popup is open.
|
||||
*/
|
||||
get isOpen() {
|
||||
return this._panel.state == "open";
|
||||
return this._panel.state == "open" || this._panel.state == "showing";
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,7 +30,7 @@ function setupAutoCompletion(ctx, walker) {
|
|||
|
||||
let keyMap = {
|
||||
"Tab": cm => {
|
||||
if (popup && (popup.isOpen || popup._panel.state == "showing")) {
|
||||
if (popup && popup.isOpen) {
|
||||
cycleSuggestions(ed);
|
||||
return;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ function setupAutoCompletion(ctx, walker) {
|
|||
return win.CodeMirror.Pass;
|
||||
},
|
||||
"Shift-Tab": cm => {
|
||||
if (popup && (popup.isOpen || popup._panel.state == "showing")) {
|
||||
if (popup && popup.isOpen) {
|
||||
cycleSuggestions(ed, true);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -125,8 +125,7 @@ function checkState() {
|
|||
info("After keypress for index " + index);
|
||||
let [key, total, current, inserted] = TEST_CASES[index];
|
||||
if (total != -1) {
|
||||
ok(gPopup._panel.state == "open" || gPopup._panel.state == "showing",
|
||||
"Popup is open for index " + index);
|
||||
ok(gPopup.isOpen, "Popup is open for index " + index);
|
||||
is(total, gPopup.itemCount,
|
||||
"Correct total suggestions for index " + index);
|
||||
is(current, gPopup.selectedIndex,
|
||||
|
|
|
@ -105,9 +105,7 @@ function checkState(event) {
|
|||
state);
|
||||
}
|
||||
else {
|
||||
ok(editor.popup._panel.state == "open" ||
|
||||
editor.popup._panel.state == "showing",
|
||||
"Popup is open for state " + state);
|
||||
ok(editor.popup.isOpen, "Popup is open for state " + state);
|
||||
is(editor.popup.getItems().length, total,
|
||||
"Number of suggestions match for state " + state);
|
||||
is(editor.popup.selectedIndex, index,
|
||||
|
|
|
@ -117,9 +117,7 @@ function checkState(event) {
|
|||
state);
|
||||
}
|
||||
else {
|
||||
ok(editor.popup._panel.state == "open" ||
|
||||
editor.popup._panel.state == "showing",
|
||||
"Popup is open for state " + state);
|
||||
ok(editor.popup.isOpen, "Popup is open for state " + state);
|
||||
is(editor.popup.getItems().length, total,
|
||||
"Number of suggestions match for state " + state);
|
||||
is(editor.popup.selectedIndex, index,
|
||||
|
|
|
@ -114,9 +114,7 @@ function checkState(event) {
|
|||
state);
|
||||
}
|
||||
else {
|
||||
ok(editor.popup._panel.state == "open" ||
|
||||
editor.popup._panel.state == "showing",
|
||||
"Popup is open for state " + state);
|
||||
ok(editor.popup.isOpen, "Popup is open for state " + state);
|
||||
is(editor.popup.getItems().length, total,
|
||||
"Number of suggestions match for state " + state);
|
||||
is(editor.popup.selectedIndex, index,
|
||||
|
|
Загрузка…
Ссылка в новой задаче