bug 1126511 - update Yahoo search plugins to use per-access point tags for better reporting/analysis, Fennec portion, r=margaret/mfinkle

This commit is contained in:
Mike Connor 2015-02-05 11:24:54 -05:00
Родитель 0697687a08
Коммит 38bd36d34c
3 изменённых файлов: 35 добавлений и 11 удалений

Просмотреть файл

@ -13,7 +13,7 @@ function test() {
let engine = Services.search.getEngineByName("Yahoo");
ok(engine, "Yahoo");
let base = "https://search.yahoo.com/yhs/search?p=foo&ei=UTF-8&hspart=mozilla&hsimp=yhs-001";
let base = "https://search.yahoo.com/yhs/search?p=foo&ei=UTF-8&hspart=mozilla";
let url;
// Test search URLs (including purposes).
@ -29,7 +29,7 @@ function test() {
name: "Yahoo",
alias: null,
description: "Yahoo Search",
searchForm: "https://search.yahoo.com/yhs/search?p=&ei=UTF-8&hspart=mozilla&hsimp=yhs-001",
searchForm: "https://search.yahoo.com/yhs/search?p=&ei=UTF-8&hspart=mozilla",
type: Ci.nsISearchEngine.TYPE_MOZSEARCH,
hidden: false,
wrappedJSObject: {
@ -81,7 +81,27 @@ function test() {
{
name: "hsimp",
value: "yhs-001",
purpose: undefined,
purpose: "searchbar",
},
{
name: "hsimp",
value: "yhs-002",
purpose: "keyword",
},
{
name: "hsimp",
value: "yhs-003",
purpose: "homepage",
},
{
name: "hsimp",
value: "yhs-004",
purpose: "newtab",
},
{
name: "hsimp",
value: "yhs-005",
purpose: "contextmenu",
},
],
mozparams: {},

Просмотреть файл

@ -18,7 +18,7 @@ function test() {
Services.search.currentEngine = engine;
engine.alias = "y";
let base = "https://search.yahoo.com/yhs/search?p=foo&ei=UTF-8&hspart=mozilla&hsimp=yhs-001";
let base = "https://search.yahoo.com/yhs/search?p=foo&ei=UTF-8&hspart=mozilla";
let url;
// Test search URLs (including purposes).
@ -31,7 +31,7 @@ function test() {
var gTests = [
{
name: "context menu search",
searchURL: base,
searchURL: base + "&hsimp=yhs-005",
run: function () {
// Simulate a contextmenu search
// FIXME: This is a bit "low-level"...
@ -40,7 +40,7 @@ function test() {
},
{
name: "keyword search",
searchURL: base,
searchURL: base + "&hsimp=yhs-002",
run: function () {
gURLBar.value = "? foo";
gURLBar.focus();
@ -48,8 +48,8 @@ function test() {
}
},
{
name: "keyword search",
searchURL: base,
name: "keyword search with alias",
searchURL: base + "&hsimp=yhs-002",
run: function () {
gURLBar.value = "y foo";
gURLBar.focus();
@ -58,7 +58,7 @@ function test() {
},
{
name: "search bar search",
searchURL: base,
searchURL: base + "&hsimp=yhs-001",
run: function () {
let sb = BrowserSearch.searchBar;
sb.focus();
@ -71,7 +71,7 @@ function test() {
},
{
name: "new tab search",
searchURL: base,
searchURL: base + "&hsimp=yhs-004",
run: function () {
function doSearch(doc) {
// Re-add the listener, and perform a search

Просмотреть файл

@ -20,6 +20,10 @@
<Param name="p" value="{searchTerms}"/>
<Param name="ei" value="UTF-8"/>
<Param name="hspart" value="mozilla"/>
<Param name="hsimp" value="yhs-001"/>
<MozParam name="hsimp" condition="purpose" purpose="searchbar" value="yhs-001"/>
<MozParam name="hsimp" condition="purpose" purpose="keyword" value="yhs-002"/>
<MozParam name="hsimp" condition="purpose" purpose="homepage" value="yhs-003"/>
<MozParam name="hsimp" condition="purpose" purpose="newtab" value="yhs-004"/>
<MozParam name="hsimp" condition="purpose" purpose="contextmenu" value="yhs-005"/>
</Url>
</SearchPlugin>