mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 916534 - Test for find highlight should work in subframes. r=mikdeboer
This commit is contained in:
parent
d5d7de306d
commit
aa1efbba84
@ -6,8 +6,8 @@
|
||||
MOCHITEST_BROWSER_FILES = \
|
||||
browser_DeferredTask.js \
|
||||
browser_Deprecated.js \
|
||||
browser_Finder.js \
|
||||
browser_Geometry.js \
|
||||
browser_InlineSpellChecker.js \
|
||||
browser_Troubleshoot.js \
|
||||
|
||||
$(NULL)
|
||||
|
46
toolkit/modules/tests/browser/browser_Finder.js
Normal file
46
toolkit/modules/tests/browser/browser_Finder.js
Normal file
@ -0,0 +1,46 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
let tab, browser;
|
||||
|
||||
function test () {
|
||||
waitForExplicitFinish();
|
||||
|
||||
tab = gBrowser.addTab("data:text/html,<iframe srcdoc='content'/>");
|
||||
browser = gBrowser.getBrowserForTab(tab);
|
||||
gBrowser.selectedTab = tab;
|
||||
|
||||
browser.addEventListener("load", startTests, true);
|
||||
}
|
||||
|
||||
function startTests () {
|
||||
browser.removeEventListener("load", startTests, true);
|
||||
|
||||
let finder = browser.finder;
|
||||
let listener = {
|
||||
onFindResult: function () {
|
||||
ok(false, "callback wasn't replaced");
|
||||
}
|
||||
};
|
||||
finder.addResultListener(listener);
|
||||
|
||||
listener.onFindResult = function (result) {
|
||||
ok(result == Ci.nsITypeAheadFind.FIND_FOUND, "should find string");
|
||||
|
||||
listener.onFindResult = function (result) {
|
||||
ok(result == Ci.nsITypeAheadFind.FIND_NOTFOUND, "should not find string");
|
||||
|
||||
cleanup();
|
||||
}
|
||||
finder.highlight(true, "Bla");
|
||||
}
|
||||
finder.highlight(true, "content");
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
gBrowser.removeTab(tab);
|
||||
finish();
|
||||
}
|
Loading…
Reference in New Issue
Block a user