зеркало из https://github.com/mozilla/gecko-dev.git
Bug 365551 - Auto-case mode erroneously shows Match Case box sometimes. r=gavin.
This commit is contained in:
Родитель
12a7e11ca9
Коммит
c2ca145a4d
|
@ -104,6 +104,7 @@
|
|||
testNormalFind();
|
||||
gFindBar.close();
|
||||
ok(gFindBar.hidden, "Failed to close findbar after testNormalFind");
|
||||
testAutoCaseSensitivityUI();
|
||||
testQuickFindText();
|
||||
gFindBar.close();
|
||||
ok(gFindBar.hidden, "Failed to close findbar after testQuickFindText");
|
||||
|
@ -164,6 +165,37 @@
|
|||
}
|
||||
}
|
||||
|
||||
function testAutoCaseSensitivityUI() {
|
||||
var matchCaseCheckbox = gFindBar.getElement("find-case-sensitive");
|
||||
var matchCaseLabel = gFindBar.getElement("match-case-status");
|
||||
document.getElementById("cmd_find").doCommand();
|
||||
ok(!matchCaseCheckbox.hidden, "match case box is hidden in manual mode");
|
||||
ok(matchCaseLabel.hidden, "match case label is visible in manual mode");
|
||||
|
||||
var prefsvc = Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Components.interfaces.nsIPrefBranch2);
|
||||
prefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 2);
|
||||
|
||||
ok(matchCaseCheckbox.hidden,
|
||||
"match case box is visible in automatic mode");
|
||||
ok(!matchCaseLabel.hidden,
|
||||
"match case label is hidden in automatic mode");
|
||||
|
||||
enterStringIntoFindField("a");
|
||||
var insensitiveLabel = matchCaseLabel.value;
|
||||
enterStringIntoFindField("A");
|
||||
var sensitiveLabel = matchCaseLabel.value;
|
||||
ok(insensitiveLabel != sensitiveLabel,
|
||||
"Case Sensitive label was not correctly updated");
|
||||
|
||||
// bug 365551
|
||||
gFindBar.onFindAgainCommand();
|
||||
ok(matchCaseCheckbox.hidden && !matchCaseLabel.hidden,
|
||||
"bug 365551: case sensitivity UI is broken after find-again");
|
||||
prefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 0);
|
||||
gFindBar.close();
|
||||
}
|
||||
|
||||
function clearFocus() {
|
||||
document.commandDispatcher.focusedElement = null;
|
||||
document.commandDispatcher.focusedWindow = null;
|
||||
|
|
|
@ -708,9 +708,7 @@
|
|||
if (this.hidden) {
|
||||
this.hidden = false;
|
||||
|
||||
this._updateCaseSensitivity(this._findField.value);
|
||||
this._updateStatusUI(this.nsITypeAheadFind.FIND_FOUND);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -1052,6 +1050,7 @@
|
|||
|
||||
nodes[i].hidden = showMinimalUI;
|
||||
}
|
||||
this._updateCaseSensitivity();
|
||||
|
||||
if (this._findMode == this.FIND_TYPEAHEAD)
|
||||
this.getElement("find-label").value = this._fastFindStr;
|
||||
|
|
Загрузка…
Ссылка в новой задаче