зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1070778, bug 1073846) for bc1 bustage
Backed out changeset c5f1d81d3849 (bug 1070778) Backed out changeset b327a052e47f (bug 1073846) --HG-- extra : rebase_source : 49d62043ba91398f370997868bba693ccc6d8251
This commit is contained in:
Родитель
79c8be2f01
Коммит
fe1673fc99
|
@ -296,8 +296,6 @@ skip-if = e10s # Bug ?????? - test directly manipulates content (directly gets e
|
|||
[browser_bug1015721.js]
|
||||
skip-if = os == 'win' || e10s # Bug 1056146 - FullZoomHelper uses promiseTabLoadEvent() which isn't e10s friendly
|
||||
[browser_bug1064280_changeUrlInPinnedTab.js]
|
||||
[browser_bug1070778.js]
|
||||
skip-if = os == "linux" # Bug 1073339 - Investigate autocomplete test unreliability on Linux
|
||||
[browser_canonizeURL.js]
|
||||
skip-if = e10s # Bug ?????? - [JavaScript Error: "Error in AboutHome.sendAboutHomeData TypeError: target.messageManager is undefined" {file: "resource:///modules/AboutHome.jsm" line: 208}]
|
||||
[browser_contentAreaClick.js]
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function* promiseAutoComplete(inputText) {
|
||||
gURLBar.focus();
|
||||
gURLBar.value = inputText.slice(0, -1);
|
||||
EventUtils.synthesizeKey(inputText.slice(-1) , {});
|
||||
yield promiseSearchComplete();
|
||||
}
|
||||
|
||||
function is_selected(index) {
|
||||
is(gURLBar.popup.richlistbox.selectedIndex, index, `Item ${index + 1} should be selected`);
|
||||
}
|
||||
|
||||
add_task(function*() {
|
||||
// This test is only relevant if UnifiedComplete is enabled.
|
||||
if (!Services.prefs.getBoolPref("browser.urlbar.unifiedcomplete"))
|
||||
return;
|
||||
|
||||
let itemIds = [];
|
||||
registerCleanupFunction(() => {
|
||||
itemIds.forEach(PlacesUtils.bookmarks.removeItem);
|
||||
});
|
||||
|
||||
let itemId =
|
||||
PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
|
||||
NetUtil.newURI("http://example.com/?q=%s"),
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
"test");
|
||||
PlacesUtils.bookmarks.setKeywordForBookmark(itemId, "keyword");
|
||||
itemIds.push(itemId);
|
||||
|
||||
// This item only needed so we can select the keyword item, select something
|
||||
// else, then select the keyword item again.
|
||||
itemId =
|
||||
PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
|
||||
NetUtil.newURI("http://example.com/keyword"),
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
"keyword abc");
|
||||
itemIds.push(itemId);
|
||||
|
||||
yield promiseAutoComplete("keyword a");
|
||||
|
||||
// Select keyword item
|
||||
EventUtils.synthesizeKey("VK_DOWN", {});
|
||||
is_selected(0);
|
||||
// Select next one (important!)
|
||||
EventUtils.synthesizeKey("VK_DOWN", {});
|
||||
is_selected(1);
|
||||
// Re-select keyword item
|
||||
EventUtils.synthesizeKey("VK_UP", {});
|
||||
is_selected(0);
|
||||
|
||||
EventUtils.synthesizeKey("b", {});
|
||||
yield promiseSearchComplete();
|
||||
|
||||
is(gURLBar.value, "keyword ab", "urlbar should have expected input");
|
||||
|
||||
let result = gURLBar.popup.richlistbox.firstChild;
|
||||
isnot(result, null, "Should have first item");
|
||||
let uri = NetUtil.newURI(result.getAttribute("url"));
|
||||
is(uri.spec, makeActionURI("keyword", {url: "http://example.com/?q=ab", input: "keyword ab"}).spec, "Expect correct url");
|
||||
|
||||
EventUtils.synthesizeKey("VK_ESCAPE", {});
|
||||
yield promisePopupHidden(gURLBar.popup);
|
||||
});
|
|
@ -31,8 +31,7 @@ let tests = [
|
|||
setup: function() {
|
||||
gURLBar.value = testActionURL;
|
||||
gURLBar.valueIsTyped = true;
|
||||
is(gURLBar._value, testActionURL, "gURLBar starts with the correct real value");
|
||||
is(gURLBar.value, testURL, "gURLBar starts with the correct display value");
|
||||
is(gURLBar.value, testActionURL, "gURLBar.value starts with correct value");
|
||||
|
||||
// Focus the urlbar so we can select it all & copy
|
||||
gURLBar.focus();
|
||||
|
@ -40,7 +39,7 @@ let tests = [
|
|||
goDoCommand("cmd_copy");
|
||||
},
|
||||
success: function() {
|
||||
is(gURLBar._value, testActionURL, "gURLBar.value didn't change when copying");
|
||||
is(gURLBar.value, testActionURL, "gURLBar.value didn't change when copying");
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -52,7 +51,7 @@ let tests = [
|
|||
goDoCommand("cmd_copy");
|
||||
},
|
||||
success: function() {
|
||||
is(gURLBar._value, testActionURL, "gURLBar.value didn't change when copying");
|
||||
is(gURLBar.value, testActionURL, "gURLBar.value didn't change when copying");
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -74,8 +73,7 @@ let tests = [
|
|||
gURLBar.value = testActionURL;
|
||||
gURLBar.valueIsTyped = true;
|
||||
// Sanity check that we have the right value
|
||||
is(gURLBar._value, testActionURL, "gURLBar starts with the correct real value");
|
||||
is(gURLBar.value, testURL, "gURLBar starts with the correct display value");
|
||||
is(gURLBar.value, testActionURL, "gURLBar.value starts with correct value");
|
||||
|
||||
// Now just select part of the value & cut that.
|
||||
gURLBar.selectionStart = testURL.length - 10;
|
||||
|
|
|
@ -125,6 +125,19 @@
|
|||
|
||||
<field name="_value">""</field>
|
||||
|
||||
<!--
|
||||
onBeforeValueGet is called by the base-binding's .value getter.
|
||||
It can return an object with a "value" property, to override the
|
||||
return value of the getter.
|
||||
-->
|
||||
<method name="onBeforeValueGet">
|
||||
<body><![CDATA[
|
||||
if (this.hasAttribute("actiontype"))
|
||||
return {value: this._value};
|
||||
return null;
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<!--
|
||||
onBeforeValueSet is called by the base-binding's .value setter.
|
||||
It should return the value that the setter should use.
|
||||
|
@ -715,10 +728,8 @@
|
|||
]]></body>
|
||||
</method>
|
||||
|
||||
<property name="textValue">
|
||||
<getter><![CDATA[
|
||||
return this.inputField.value;
|
||||
]]></getter>
|
||||
<property name="textValue"
|
||||
onget="return this.value;">
|
||||
<setter>
|
||||
<![CDATA[
|
||||
try {
|
||||
|
|
|
@ -711,8 +711,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
|
||||
|
@ -721,11 +725,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]
|
||||
|
|
|
@ -260,6 +260,11 @@
|
|||
<field name="_disableTrim">false</field>
|
||||
<property name="value">
|
||||
<getter><![CDATA[
|
||||
if (typeof this.onBeforeValueGet == "function") {
|
||||
var result = this.onBeforeValueGet();
|
||||
if (result)
|
||||
return result.value;
|
||||
}
|
||||
return this.inputField.value;
|
||||
]]></getter>
|
||||
<setter><![CDATA[
|
||||
|
|
Загрузка…
Ссылка в новой задаче