mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 658e5f8a8daf (bug 890690)
This commit is contained in:
parent
45dac40355
commit
cebbf2612b
@ -254,60 +254,6 @@ let gTests = [
|
||||
searchbar.select();
|
||||
return deferred.promise;
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
desc: "Check POST search engine support",
|
||||
setup: function() {},
|
||||
run: function()
|
||||
{
|
||||
let deferred = Promise.defer();
|
||||
let currEngine = Services.search.defaultEngine;
|
||||
let searchObserver = function search_observer(aSubject, aTopic, aData) {
|
||||
let engine = aSubject.QueryInterface(Ci.nsISearchEngine);
|
||||
info("Observer: " + aData + " for " + engine.name);
|
||||
|
||||
if (aData != "engine-added")
|
||||
return;
|
||||
|
||||
if (engine.name != "POST Search")
|
||||
return;
|
||||
|
||||
Services.search.defaultEngine = engine;
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.search.removeEngine(engine);
|
||||
Services.search.defaultEngine = currEngine;
|
||||
});
|
||||
|
||||
let needle = "Search for something awesome.";
|
||||
|
||||
// Ready to execute the tests!
|
||||
promiseBrowserAttributes(gBrowser.selectedTab).then(function() {
|
||||
let document = gBrowser.selectedTab.linkedBrowser.contentDocument;
|
||||
let searchText = document.getElementById("searchText");
|
||||
|
||||
waitForLoad(function() {
|
||||
let loadedText = gBrowser.contentDocument.body.textContent;
|
||||
ok(loadedText, "search page loaded");
|
||||
is(loadedText, "searchterms=" + escape(needle.replace(/\s/g, "+")),
|
||||
"Search text should arrive correctly");
|
||||
deferred.resolve();
|
||||
});
|
||||
|
||||
searchText.value = needle;
|
||||
searchText.focus();
|
||||
EventUtils.synthesizeKey("VK_RETURN", {});
|
||||
});
|
||||
};
|
||||
Services.obs.addObserver(searchObserver, "browser-search-engine-modified", false);
|
||||
registerCleanupFunction(function () {
|
||||
Services.obs.removeObserver(searchObserver, "browser-search-engine-modified");
|
||||
});
|
||||
Services.search.addEngine("http://test:80/browser/browser/base/content/test/POSTSearchEngine.xml",
|
||||
Ci.nsISearchEngine.DATA_XML, null, false);
|
||||
return deferred.promise;
|
||||
}
|
||||
}
|
||||
|
||||
];
|
||||
@ -496,15 +442,3 @@ function getNumberOfSearchesByDate(aEngineName, aData, aDate) {
|
||||
|
||||
return 0; // No records found.
|
||||
}
|
||||
|
||||
function waitForLoad(cb) {
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
browser.addEventListener("load", function listener() {
|
||||
if (browser.currentURI.spec == "about:blank")
|
||||
return;
|
||||
info("Page loaded: " + browser.currentURI.spec);
|
||||
browser.removeEventListener("load", listener, true);
|
||||
|
||||
cb();
|
||||
}, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user