mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Clean up browser_contextmenu.js, no bug
--HG-- extra : rebase_source : 0c06c1377f09e413740e00f4d07267853242f343
This commit is contained in:
parent
d1519fbef7
commit
27804c2fa4
@ -30,7 +30,6 @@ function test() {
|
||||
}
|
||||
}
|
||||
|
||||
registerCleanupFunction(finalize);
|
||||
Services.obs.addObserver(observer, "browser-search-engine-modified", false);
|
||||
ss.addEngine("http://mochi.test:8888/browser/browser/components/search/test/testEngine_mozsearch.xml",
|
||||
Ci.nsISearchEngine.DATA_XML, "data:image/x-icon,%00",
|
||||
@ -41,7 +40,10 @@ function test() {
|
||||
ok(contextMenu, "Got context menu XUL");
|
||||
|
||||
doOnloadOnce(testContextMenu);
|
||||
gBrowser.selectedTab = gBrowser.addTab("data:text/plain;charset=utf8,test%20search");
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab("data:text/plain;charset=utf8,test%20search");
|
||||
registerCleanupFunction(function () {
|
||||
gBrowser.removeTab(tab);
|
||||
});
|
||||
}
|
||||
|
||||
function testContextMenu() {
|
||||
@ -69,7 +71,9 @@ function test() {
|
||||
is(event.originalTarget.URL,
|
||||
"http://mochi.test:8888/browser/browser/components/search/test/?test=test+search&ie=utf-8&client=app&channel=contextsearch",
|
||||
"Checking context menu search URL");
|
||||
finalize();
|
||||
// Remove the tab opened by the search
|
||||
gBrowser.removeCurrentTab();
|
||||
ss.removeEngine(ss.currentEngine);
|
||||
}
|
||||
|
||||
var selectionListener = {
|
||||
@ -93,14 +97,4 @@ function test() {
|
||||
goDoCommand('cmd_selectAll');
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function finalize() {
|
||||
while (gBrowser.tabs.length != 1) {
|
||||
gBrowser.removeTab(gBrowser.tabs[0]);
|
||||
}
|
||||
content.location.href = "about:blank";
|
||||
var engine = ss.getEngineByName(ENGINE_NAME);
|
||||
if (engine)
|
||||
ss.removeEngine(engine);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user