mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 01a525d9c6c2 (bug 1073846) for suspicion of causing dt1 test failures
This commit is contained in:
parent
67cdab138a
commit
09f71bfe25
@ -712,8 +712,12 @@ Search.prototype = {
|
||||
// with an alias - which works like a keyword.
|
||||
hasFirstResult = yield this._matchSearchEngineAlias();
|
||||
}
|
||||
|
||||
let shouldAutofill = this._shouldAutofill;
|
||||
if (this.pending && !hasFirstResult && shouldAutofill) {
|
||||
// Or it may look like a URL we know about from search engines.
|
||||
hasFirstResult = yield this._matchSearchEngineUrl();
|
||||
}
|
||||
|
||||
if (this.pending && !hasFirstResult && shouldAutofill) {
|
||||
// It may also look like a URL we know from the database.
|
||||
// Here we can only try to predict whether the URL autofill query is
|
||||
@ -722,11 +726,6 @@ Search.prototype = {
|
||||
hasFirstResult = yield this._matchKnownUrl(conn, queries);
|
||||
}
|
||||
|
||||
if (this.pending && !hasFirstResult && shouldAutofill) {
|
||||
// Or it may look like a URL we know about from search engines.
|
||||
hasFirstResult = yield this._matchSearchEngineUrl();
|
||||
}
|
||||
|
||||
if (this.pending && this._enableActions && !hasFirstResult) {
|
||||
// If we don't have a result that matches what we know about, then
|
||||
// we use a fallback for things we don't know about.
|
||||
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
|
||||
<ShortName>engine-rel-searchform.xml</ShortName>
|
||||
<Url type="text/html" method="GET" template="http://example.com/?search" rel="searchform"/>
|
||||
</SearchPlugin>
|
@ -1,42 +1,6 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://testing-common/httpd.js");
|
||||
|
||||
function* addTestEngines(items) {
|
||||
let httpServer = new HttpServer();
|
||||
httpServer.start(-1);
|
||||
httpServer.registerDirectory("/", do_get_cwd());
|
||||
let gDataUrl = "http://localhost:" + httpServer.identity.primaryPort + "/data/";
|
||||
do_register_cleanup(() => httpServer.stop(() => {}));
|
||||
|
||||
let engines = [];
|
||||
|
||||
for (let item of items) {
|
||||
do_print("Adding engine: " + item);
|
||||
yield new Promise(resolve => {
|
||||
Services.obs.addObserver(function obs(subject, topic, data) {
|
||||
let engine = subject.QueryInterface(Ci.nsISearchEngine);
|
||||
do_print("Observed " + data + " for " + engine.name);
|
||||
if (data != "engine-added" || engine.name != item) {
|
||||
return;
|
||||
}
|
||||
|
||||
Services.obs.removeObserver(obs, "browser-search-engine-modified");
|
||||
engines.push(engine);
|
||||
resolve();
|
||||
}, "browser-search-engine-modified", false);
|
||||
|
||||
do_print("`Adding engine from URL: " + gDataUrl + item);
|
||||
Services.search.addEngine(gDataUrl + item,
|
||||
Ci.nsISearchEngine.DATA_XML, null, false);
|
||||
});
|
||||
}
|
||||
|
||||
return engines;
|
||||
}
|
||||
|
||||
|
||||
add_task(function* test_searchEngine_autoFill() {
|
||||
Services.search.addEngineWithDetails("MySearchEngine", "", "", "",
|
||||
"GET", "http://my.search.com/");
|
||||
@ -51,7 +15,7 @@ add_task(function* test_searchEngine_autoFill() {
|
||||
}
|
||||
yield promiseAddVisits(visits);
|
||||
addBookmark({ uri: uri, title: "Example bookmark" });
|
||||
ok(frecencyForUrl(uri) > 10000, "Adeded URI should have expected high frecency");
|
||||
Assert.ok(frecencyForUrl(uri) > 10000);
|
||||
|
||||
do_log_info("Check search domain is autoFilled even if there's an higher frecency match");
|
||||
yield check_autocomplete({
|
||||
@ -62,23 +26,3 @@ add_task(function* test_searchEngine_autoFill() {
|
||||
|
||||
yield cleanup();
|
||||
});
|
||||
|
||||
add_task(function* test_searchEngine_noautoFill() {
|
||||
let engineName = "engine-rel-searchform.xml";
|
||||
let [engine] = yield addTestEngines([engineName]);
|
||||
do_register_cleanup(() => Services.search.removeEngine(engine));
|
||||
equal(engine.searchForm, "http://example.com/?search");
|
||||
|
||||
Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
|
||||
yield promiseAddVisits(NetUtil.newURI("http://example.com/my/"));
|
||||
|
||||
do_print("Check search domain is not autoFilled if it matches a visited domain");
|
||||
yield check_autocomplete({
|
||||
search: "example",
|
||||
autofilled: "example.com/",
|
||||
completed: "example.com/"
|
||||
});
|
||||
|
||||
yield cleanup();
|
||||
});
|
||||
|
||||
|
@ -1,9 +1,6 @@
|
||||
[DEFAULT]
|
||||
head = head_autocomplete.js
|
||||
tail =
|
||||
support-files =
|
||||
data/engine-rel-searchform.xml
|
||||
|
||||
|
||||
[test_416211.js]
|
||||
[test_416214.js]
|
||||
|
Loading…
Reference in New Issue
Block a user