Bug 365551 - Auto-case mode erroneously shows Match Case box sometimes. r=gavin.

git-svn-id: svn://10.0.0.236/trunk@226339 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mozilla.mano%sent.com
2007-05-13 06:27:11 +00:00
parent e486fc0545
commit dfce6f612e
2 changed files with 33 additions and 2 deletions

View File

@@ -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;

View File

@@ -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;