Backed out 2 changesets (bug 1656220, bug 1656219) for browser-chrome failures at browser_UsageTelemetry_urlbar.js and browser_oneOffs.js on a CLOSED TREE

Backed out changeset bf68aec38a05 (bug 1656220)
Backed out changeset 706d2900077b (bug 1656219)
This commit is contained in:
Cristina Coroiu 2020-08-20 14:15:07 +03:00
Родитель 850817430e
Коммит 3a18ab95b5
21 изменённых файлов: 39 добавлений и 579 удалений

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

@ -253,7 +253,6 @@ let ContentSearch = {
}
win.BrowserSearch.recordSearchInTelemetry(engine, data.healthReportKey, {
selection: data.selection,
url: submission.uri,
});
},

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

@ -1313,8 +1313,7 @@ pref("prompts.tab_modal.enabled", true);
pref("prompts.defaultModalType", 3);
pref("browser.topsites.useRemoteSetting", false);
pref("browser.partnerlink.attributionURL", "https://topsites.mozilla.io/cid/amzn_2020_a1");
pref("browser.topsites.attributionURL", "");
// Whether to show tab level system prompts opened via nsIPrompt(Service) as
// SubDialogs in the TabDialogBox (true) or as TabModalPrompt in the

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

@ -4346,7 +4346,7 @@ const BrowserSearch = {
csp,
});
return { engine, url: submission.uri };
return engine;
},
/**
@ -4356,7 +4356,7 @@ const BrowserSearch = {
* BrowserSearch.loadSearch for the preferred API.
*/
async loadSearchFromContext(terms, usePrivate, triggeringPrincipal, csp) {
let { engine, url } = await BrowserSearch._loadSearch(
let engine = await BrowserSearch._loadSearch(
terms,
usePrivate && !PrivateBrowsingUtils.isWindowPrivate(window)
? "window"
@ -4369,7 +4369,7 @@ const BrowserSearch = {
csp
);
if (engine) {
BrowserSearch.recordSearchInTelemetry(engine, "contextmenu", { url });
BrowserSearch.recordSearchInTelemetry(engine, "contextmenu");
}
},
@ -4377,7 +4377,7 @@ const BrowserSearch = {
* Perform a search initiated from the command line.
*/
async loadSearchFromCommandLine(terms, usePrivate, triggeringPrincipal, csp) {
let { engine, url } = await BrowserSearch._loadSearch(
let engine = await BrowserSearch._loadSearch(
terms,
"current",
usePrivate,
@ -4386,7 +4386,7 @@ const BrowserSearch = {
csp
);
if (engine) {
BrowserSearch.recordSearchInTelemetry(engine, "system", { url });
BrowserSearch.recordSearchInTelemetry(engine, "system");
}
},

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

@ -117,8 +117,7 @@ this.search = class extends ExtensionAPI {
BrowserUsageTelemetry.recordSearch(
tabbrowser,
engine,
"webextension",
{ url: submission.uri }
"webextension"
);
},
},

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

@ -421,7 +421,6 @@
isOneOff: aOneOff,
isSuggestion: !aOneOff && telemetrySearchDetails,
selection: telemetrySearchDetails,
url: submission.uri,
};
BrowserSearch.recordSearchInTelemetry(engine, "searchbar", details);
// null parameter below specifies HTML response for search

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

@ -474,7 +474,7 @@ class UrlbarInput {
selectedOneOff.engine,
searchString
);
this._recordSearch(selectedOneOff.engine, event, url);
this._recordSearch(selectedOneOff.engine, event);
UrlbarUtils.addToFormHistory(
this,
@ -776,7 +776,6 @@ class UrlbarInput {
isSuggestion: !!result.payload.suggestion,
isFormHistory: result.source == UrlbarUtils.RESULT_SOURCE.HISTORY,
alias: result.payload.keyword,
url,
};
const engine = Services.search.getEngineByName(result.payload.engine);
this._recordSearch(engine, event, actionDetails);
@ -1826,8 +1825,6 @@ class UrlbarInput {
* True if this query was initiated via a search alias.
* @param {boolean} searchActionDetails.isFormHistory
* True if this query was initiated from a form history result.
* @param {string} searchActionDetails.url
* The url this query was triggered with.
*/
_recordSearch(engine, event, searchActionDetails = {}) {
const isOneOff = this.view.oneOffSearchButtons.maybeRecordTelemetry(event);

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

@ -23,7 +23,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
CustomizableUI: "resource:///modules/CustomizableUI.jsm",
OS: "resource://gre/modules/osfile.jsm",
PageActions: "resource:///modules/PageActions.jsm",
PartnerLinkAttribution: "resource:///modules/PartnerLinkAttribution.jsm",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
SearchTelemetry: "resource:///modules/SearchTelemetry.jsm",
Services: "resource://gre/modules/Services.jsm",
@ -605,11 +604,7 @@ let BrowserUsageTelemetry = {
this._handleSearchAction(engine, source, details);
},
_recordSearch(engine, url, source, action = null) {
PartnerLinkAttribution.makeSearchEngineRequest(engine, url).catch(
Cu.reportError
);
_recordSearch(engine, source, action = null) {
let scalarKey = action ? "search_" + action : "search";
Services.telemetry.keyedScalarAdd(
"browser.engagement.navigation." + source,
@ -631,15 +626,15 @@ let BrowserUsageTelemetry = {
this._handleSearchAndUrlbar(engine, source, details);
break;
case "abouthome":
this._recordSearch(engine, details.url, "about_home", "enter");
this._recordSearch(engine, "about_home", "enter");
break;
case "newtab":
this._recordSearch(engine, details.url, "about_newtab", "enter");
this._recordSearch(engine, "about_newtab", "enter");
break;
case "contextmenu":
case "system":
case "webextension":
this._recordSearch(engine, details.url, source);
this._recordSearch(engine, source);
break;
}
},
@ -670,27 +665,27 @@ let BrowserUsageTelemetry = {
}
// If that's a legit one-off search signal, record it using the relative key.
this._recordSearch(engine, details.url, sourceName, "oneoff");
this._recordSearch(engine, sourceName, "oneoff");
return;
}
// The search was not a one-off. It was a search with the default search engine.
if (details.isFormHistory) {
// It came from a form history result.
this._recordSearch(engine, details.url, sourceName, "formhistory");
this._recordSearch(engine, sourceName, "formhistory");
return;
} else if (details.isSuggestion) {
// It came from a suggested search, so count it as such.
this._recordSearch(engine, details.url, sourceName, "suggestion");
this._recordSearch(engine, sourceName, "suggestion");
return;
} else if (details.alias) {
// This one came from a search that used an alias.
this._recordSearch(engine, details.url, sourceName, "alias");
this._recordSearch(engine, sourceName, "alias");
return;
}
// The search signal was generated by typing something and pressing enter.
this._recordSearch(engine, details.url, sourceName, "enter");
this._recordSearch(engine, sourceName, "enter");
},
/**

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

@ -8,14 +8,17 @@ Cu.importGlobalProperties(["fetch"]);
var EXPORTED_SYMBOLS = ["PartnerLinkAttribution"];
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
ChromeUtils.defineModuleGetter(
this,
"Services",
"resource://gre/modules/Services.jsm"
);
XPCOMUtils.defineLazyModuleGetters(this, {
Services: "resource://gre/modules/Services.jsm",
Region: "resource://gre/modules/Region.jsm",
});
ChromeUtils.defineModuleGetter(
this,
"Region",
"resource://gre/modules/Region.jsm"
);
var PartnerLinkAttribution = {
async makeRequest({ targetURL, source }) {
@ -31,7 +34,7 @@ var PartnerLinkAttribution = {
const attributionUrl = Services.prefs.getStringPref(
Services.prefs.getBoolPref("browser.topsites.useRemoteSetting")
? "browser.partnerlink.attributionURL"
? "browser.topsites.attributionURL"
: `browser.newtabpage.searchTileOverride.${partner}.attributionURL`,
""
);
@ -39,67 +42,15 @@ var PartnerLinkAttribution = {
record("attribution", "abort");
return;
}
let result = await sendRequest(attributionUrl, source, targetURL);
record("attribution", result ? "success" : "failure");
},
/**
* Makes a request to the attribution URL for a search engine search.
*
* @param {nsISearchEngine} engine
* The search engine to save the attribution for.
* @param {nsIURI} targetUrl
* The target URL to filter and include in the attribution.
*/
async makeSearchEngineRequest(engine, targetUrl) {
if (!engine.sendAttributionRequest) {
return;
}
let searchUrlQueryParamName = engine.searchUrlQueryParamName;
if (!searchUrlQueryParamName) {
Cu.reportError("makeSearchEngineRequest can't find search terms key");
return;
}
let url = targetUrl;
if (typeof url == "string") {
url = Services.io.newURI(url);
}
let targetParams = new URLSearchParams(url.query);
if (!targetParams.has(searchUrlQueryParamName)) {
Cu.reportError(
"makeSearchEngineRequest can't remove target search terms"
);
return;
}
const attributionUrl = Services.prefs.getStringPref(
"browser.partnerlink.attributionURL",
""
);
targetParams.delete(searchUrlQueryParamName);
let strippedTargetUrl = `${url.prePath}${url.filePath}`;
let newParams = targetParams.toString();
if (newParams) {
strippedTargetUrl += "?" + newParams;
}
await sendRequest(attributionUrl, "searchurl", strippedTargetUrl);
const request = new Request(attributionUrl);
request.headers.set("X-Region", Region.home);
request.headers.set("X-Source", source);
request.headers.set("X-Target-URL", targetURL);
const response = await fetch(request);
record("attribution", response.ok ? "success" : "failure");
},
};
async function sendRequest(attributionUrl, source, targetURL) {
const request = new Request(attributionUrl);
request.headers.set("X-Region", Region.home);
request.headers.set("X-Source", source);
request.headers.set("X-Target-URL", targetURL);
const response = await fetch(request);
return response.ok;
}
function recordTelemetryEvent(method, objectString, value, extra) {
Services.telemetry.setEventRecordingEnabled("partner_link", true);
Services.telemetry.recordEvent(

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

@ -15,15 +15,10 @@ support-files =
!/browser/components/search/test/browser/testEngine.xml
!/browser/components/search/test/browser/testEngine_diacritics.xml
testEngine_chromeicon.xml
skip-if = (debug && os == "linux" && bits == 64 && os_version == "18.04") # Bug 1649755
skip-if = (debug && os == "linux" && bits == 64 && os_version == "18.04") # Bug 1649755
[browser_EveryWindow.js]
[browser_LiveBookmarkMigrator.js]
[browser_PageActions.js]
[browser_PartnerLinkAttribution.js]
support-files =
search-engines/basic/manifest.json
search-engines/simple/manifest.json
search-engines/engines.json
[browser_PermissionUI.js]
[browser_PermissionUI_prompts.js]
[browser_preloading_tab_moving.js]

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

@ -1,286 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
/**
* This file tests urlbar telemetry with search related actions.
*/
"use strict";
const SCALAR_URLBAR = "browser.engagement.navigation.urlbar";
// The preference to enable suggestions in the urlbar.
const SUGGEST_URLBAR_PREF = "browser.urlbar.suggest.searches";
// The name of the search engine used to generate suggestions.
const SUGGESTION_ENGINE_NAME =
"browser_UsageTelemetry usageTelemetrySearchSuggestions.xml";
XPCOMUtils.defineLazyModuleGetters(this, {
CustomizableUITestUtils:
"resource://testing-common/CustomizableUITestUtils.jsm",
Region: "resource://gre/modules/Region.jsm",
SearchTelemetry: "resource:///modules/SearchTelemetry.jsm",
SearchTestUtils: "resource://testing-common/SearchTestUtils.jsm",
UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.jsm",
HttpServer: "resource://testing-common/httpd.js",
});
let gCUITestUtils = new CustomizableUITestUtils(window);
SearchTestUtils.init(Assert, registerCleanupFunction);
var gHttpServer = null;
var gRequests = [];
function submitHandler(request, response) {
gRequests.push(request);
response.setStatusLine(request.httpVersion, 200, "Ok");
}
add_task(async function setup() {
// Ensure the initial init is complete.
await Services.search.init();
// Clear history so that history added by previous tests doesn't mess up this
// test when it selects results in the urlbar.
await PlacesUtils.history.clear();
let searchExtensions = getChromeDir(getResolvedURI(gTestPath));
searchExtensions.append("search-engines");
await SearchTestUtils.useMochitestEngines(searchExtensions);
SearchTestUtils.useMockIdleService();
let response = await fetch(`resource://search-extensions/engines.json`);
let json = await response.json();
await SearchTestUtils.updateRemoteSettingsConfig(json.data);
gHttpServer = new HttpServer();
gHttpServer.registerPathHandler("/", submitHandler);
gHttpServer.start(-1);
await SpecialPowers.pushPrefEnv({
set: [
// Enable search suggestions in the urlbar.
[SUGGEST_URLBAR_PREF, true],
// Clear historical search suggestions to avoid interference from previous
// tests.
["browser.urlbar.maxHistoricalSearchSuggestions", 0],
// Use the default matching bucket configuration.
["browser.urlbar.matchBuckets", "general:5,suggestion:4"],
//
[
"browser.partnerlink.attributionURL",
`http://localhost:${gHttpServer.identity.primaryPort}/`,
],
],
});
await gCUITestUtils.addSearchBar();
// Make sure to restore the engine once we're done.
registerCleanupFunction(async function() {
await SearchTestUtils.updateRemoteSettingsConfig();
await gHttpServer.stop();
gHttpServer = null;
await PlacesUtils.history.clear();
gCUITestUtils.removeSearchBar();
});
});
function searchInAwesomebar(value, win = window) {
return UrlbarTestUtils.promiseAutocompleteResultPopup({
window: win,
waitForFocus,
value,
fireInputEvent: true,
});
}
add_task(async function test_simpleQuery_no_attribution() {
await Services.search.setDefault(
Services.search.getEngineByName("Simple Engine")
);
let tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
"about:blank"
);
info("Simulate entering a simple search.");
let promiseLoad = BrowserTestUtils.waitForDocLoadAndStopIt(
"https://example.com/?sourceId=Mozilla-search&search=simple+query",
tab
);
await searchInAwesomebar("simple query");
EventUtils.synthesizeKey("KEY_Enter");
await promiseLoad;
await new Promise(resolve => Services.tm.dispatchToMainThread(resolve));
Assert.equal(gRequests.length, 0, "Should not have submitted an attribution");
BrowserTestUtils.removeTab(tab);
await Services.search.setDefault(Services.search.getEngineByName("basic"));
});
async function checkAttributionRecorded(actionFn, cleanupFn) {
let tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
"data:text/plain;charset=utf8,simple%20query"
);
let promiseLoad = BrowserTestUtils.waitForDocLoadAndStopIt(
"https://mochi.test:8888/browser/browser/components/search/test/browser/?search=simple+query&foo=1",
tab
);
await actionFn(tab);
await promiseLoad;
await BrowserTestUtils.waitForCondition(
() => gRequests.length == 1,
"Should have received an attribution submission"
);
Assert.equal(
gRequests[0].getHeader("x-region"),
Region.home,
"Should have set the region correctly"
);
Assert.equal(
gRequests[0].getHeader("X-Source"),
"searchurl",
"Should have set the source correctly"
);
Assert.equal(
gRequests[0].getHeader("X-Target-url"),
"https://mochi.test:8888/browser/browser/components/search/test/browser/?foo=1",
"Should have set the target url correctly and stripped the search terms"
);
if (cleanupFn) {
await cleanupFn();
}
BrowserTestUtils.removeTab(tab);
gRequests = [];
}
add_task(async function test_urlbar() {
await checkAttributionRecorded(async tab => {
await searchInAwesomebar("simple query");
EventUtils.synthesizeKey("KEY_Enter");
});
});
add_task(async function test_searchbar() {
await checkAttributionRecorded(async tab => {
let sb = BrowserSearch.searchBar;
// Write the search query in the searchbar.
sb.focus();
sb.value = "simple query";
sb.textbox.controller.startSearch("simple query");
// Wait for the popup to show.
await BrowserTestUtils.waitForEvent(sb.textbox.popup, "popupshown");
// And then for the search to complete.
await BrowserTestUtils.waitForCondition(
() =>
sb.textbox.controller.searchStatus >=
Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH,
"The search in the searchbar must complete."
);
EventUtils.synthesizeKey("KEY_Enter");
});
});
add_task(async function test_context_menu() {
let contextMenu;
await checkAttributionRecorded(
async tab => {
info("Select all the text in the page.");
await SpecialPowers.spawn(tab.linkedBrowser, [""], async function() {
return new Promise(resolve => {
content.document.addEventListener(
"selectionchange",
() => resolve(),
{
once: true,
}
);
content.document
.getSelection()
.selectAllChildren(content.document.body);
});
});
info("Open the context menu.");
contextMenu = document.getElementById("contentAreaContextMenu");
let popupPromise = BrowserTestUtils.waitForEvent(
contextMenu,
"popupshown"
);
BrowserTestUtils.synthesizeMouseAtCenter(
"body",
{ type: "contextmenu", button: 2 },
gBrowser.selectedBrowser
);
await popupPromise;
info("Click on search.");
let searchItem = contextMenu.getElementsByAttribute(
"id",
"context-searchselect"
)[0];
searchItem.click();
},
() => {
contextMenu.hidePopup();
BrowserTestUtils.removeTab(gBrowser.selectedTab);
}
);
});
add_task(async function test_about_newtab() {
let tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
"about:newtab",
false
);
await SpecialPowers.spawn(tab.linkedBrowser, [], async function() {
await ContentTaskUtils.waitForCondition(() => !content.document.hidden);
});
info("Trigger a simple serch, just text + enter.");
let promiseLoad = BrowserTestUtils.waitForDocLoadAndStopIt(
"https://mochi.test:8888/browser/browser/components/search/test/browser/?search=simple+query&foo=1",
tab
);
await typeInSearchField(
tab.linkedBrowser,
"simple query",
"newtab-search-text"
);
await BrowserTestUtils.synthesizeKey("VK_RETURN", {}, tab.linkedBrowser);
await promiseLoad;
await BrowserTestUtils.waitForCondition(
() => gRequests.length == 1,
"Should have received an attribution submission"
);
Assert.equal(
gRequests[0].getHeader("x-region"),
Region.home,
"Should have set the region correctly"
);
Assert.equal(
gRequests[0].getHeader("X-Source"),
"searchurl",
"Should have set the source correctly"
);
Assert.equal(
gRequests[0].getHeader("X-Target-url"),
"https://mochi.test:8888/browser/browser/components/search/test/browser/?foo=1",
"Should have set the target url correctly and stripped the search terms"
);
BrowserTestUtils.removeTab(tab);
gRequests = [];
});

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

@ -1,19 +0,0 @@
{
"name": "basic",
"manifest_version": 2,
"version": "1.0",
"description": "basic",
"applications": {
"gecko": {
"id": "basic@search.mozilla.org"
}
},
"hidden": true,
"chrome_settings_overrides": {
"search_provider": {
"name": "basic",
"search_url": "https://mochi.test:8888/browser/browser/components/search/test/browser/?search={searchTerms}&foo=1",
"suggest_url": "https://mochi.test:8888/browser/browser/modules/test/browser/usageTelemetrySearchSuggestions.sjs?{searchTerms}"
}
}
}

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

@ -1,24 +0,0 @@
{
"data": [
{
"webExtension": {
"id":"basic@search.mozilla.org"
},
"telemetryId": "telemetry",
"appliesTo": [{
"included": { "everywhere": true },
"default": "yes",
"sendAttributionRequest": true
}]
},
{
"webExtension": {
"id":"simple@search.mozilla.org"
},
"appliesTo": [{
"included": { "everywhere": true },
"default": "yes"
}]
}
]
}

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

@ -1,29 +0,0 @@
{
"name": "Simple Engine",
"manifest_version": 2,
"version": "1.0",
"description": "Simple engine with a different name from the WebExtension id prefix",
"applications": {
"gecko": {
"id": "simple@search.mozilla.org"
}
},
"hidden": true,
"chrome_settings_overrides": {
"search_provider": {
"name": "Simple Engine",
"search_url": "https://example.com",
"params": [
{
"name": "sourceId",
"value": "Mozilla-search"
},
{
"name": "search",
"value": "{searchTerms}"
}
],
"suggest_url": "https://example.com?search={searchTerms}"
}
}
}

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

@ -595,8 +595,6 @@ class SearchEngine {
_queryCharset = null;
// The engine's raw SearchForm value (URL string pointing to a search form).
__searchForm = null;
// Whether or not to send an attribution request to the server.
_sendAttributionRequest = false;
// The number of days between update checks for new versions
_updateInterval = null;
// The url to check at for a new update
@ -622,9 +620,6 @@ class SearchEngine {
_definedAliases = [];
// The urls associated with this engine.
_urls = [];
// The query parameter name of the search url, cached in memory to avoid
// repeated look-ups.
_searchUrlQueryParamName = null;
/**
* Constructor.
@ -978,8 +973,6 @@ class SearchEngine {
this._telemetryId = configuration.telemetryId;
this._name = searchProvider.name.trim();
this._regionParams = configuration.regionParams;
this._sendAttributionRequest =
configuration.sendAttributionRequest ?? false;
if (shortName) {
this._shortName = shortName;
@ -1402,10 +1395,6 @@ class SearchEngine {
return this._getSearchFormWithPurpose();
}
get sendAttributionRequest() {
return this._sendAttributionRequest;
}
_getSearchFormWithPurpose(purpose) {
// First look for a <Url rel="searchform">
var searchFormURL = this._getURLOfType(
@ -1509,32 +1498,6 @@ class SearchEngine {
return url.getSubmission(submissionData, this, purpose);
}
get searchUrlQueryParamName() {
if (this._searchUrlQueryParamName != null) {
return this._searchUrlQueryParamName;
}
let submission = this.getSubmission(
"{searchTerms}",
SearchUtils.URL_TYPE.SEARCH
);
if (submission.postData) {
Cu.reportError("searchUrlQueryParamName can't handle POST urls.");
return (this._searchUrlQueryParamName = "");
}
let queryParams = new URLSearchParams(submission.uri.query);
let searchUrlQueryParamName = "";
for (let [key, value] of queryParams) {
if (value == "{searchTerms}") {
searchUrlQueryParamName = key;
}
}
return (this._searchUrlQueryParamName = searchUrlQueryParamName);
}
// from nsISearchEngine
supportsResponseType(type) {
return this._getURLOfType(type) != null;

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

@ -50,15 +50,6 @@ interface nsISearchEngine : nsISupports
[optional] in AString responseType,
[optional] in AString purpose);
/**
* Returns the name of the parameter used for the search terms for a submission
* URL of type `SearchUtils.URL_TYPE.SEARCH`.
*
* @returns A string which is the name of the parameter, or empty string
* if no parameter cannot be found or is not supported (e.g. POST).
*/
readonly attribute AString searchUrlQueryParamName;
/**
* Determines whether the engine can return responses in the given
* MIME type. Returns true if the engine spec has a URL with the
@ -139,12 +130,6 @@ interface nsISearchEngine : nsISupports
*/
readonly attribute AString searchForm;
/**
* A boolean to indicate if we should send an attribution request to Mozilla's
* server.
*/
readonly attribute boolean sendAttributionRequest;
/**
* The identifier to use for this engine when submitting to telemetry.
*/

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

@ -21,9 +21,6 @@
"$ref": "#/definitions/appliesToSection"
}
},
"sendAttributionRequest": {
"$ref": "#/definitions/sendAttributionRequest"
},
"telemetryId": {
"type": "string",
"title": "Telemetry Id",
@ -288,11 +285,6 @@
}
}
},
"sendAttributionRequest": {
"type": "boolean",
"title": "Send Attribution Request",
"description": "Indicates if we should send an attribution request to Mozilla's server."
},
"telemetryId": {
"type": "string",
"title": "Telemetry Id",
@ -407,9 +399,6 @@
"webextension": {
"$ref": "#/definitions/webExtension"
},
"sendAttributionRequest": {
"$ref": "#/definitions/sendAttributionRequest"
},
"telemetryId": {
"$ref": "#/definitions/telemetryId"
},

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

@ -4,7 +4,6 @@
"default",
"defaultPrivate",
"orderHint",
"sendAttributionRequest",
"telemetryId",
"params",
"extraParams",

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

@ -108,22 +108,6 @@ var SearchTestUtils = Object.freeze({
}
},
async useMochitestEngines(testDir) {
// Replace the path we load search engines from with
// the path to our test data.
let resProt = Services.io
.getProtocolHandler("resource")
.QueryInterface(Ci.nsIResProtocolHandler);
let originalSubstitution = resProt.getSubstitution("search-extensions");
resProt.setSubstitution(
"search-extensions",
Services.io.newURI("file://" + testDir.path)
);
gTestGlobals.registerCleanupFunction(() => {
resProt.setSubstitution("search-extensions", originalSubstitution);
});
},
/**
* Convert a list of engine configurations into engine objects.
*
@ -300,14 +284,10 @@ var SearchTestUtils = Object.freeze({
/**
* Simulates an update to the RemoteSettings configuration.
*
* @param {object} [config]
* @param {object} config
* The new configuration.
*/
async updateRemoteSettingsConfig(config) {
if (!config) {
let settings = RemoteSettings(SearchUtils.SETTINGS_KEY);
config = await settings.get();
}
const reloadObserved = SearchTestUtils.promiseSearchNotification(
"engines-reloaded"
);

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

@ -5,7 +5,6 @@
"id": "plainengine@search.mozilla.org"
},
"orderHint": 10000,
"sendAttributionRequest": true,
"appliesTo": [{
"included": { "everywhere": true },
"default": "yes-if-no-other"
@ -17,11 +16,10 @@
},
"orderHint": 7000,
"appliesTo": [{
"included": { "regions": ["tr"] },
"default": "yes"
}, {
"included": { "everywhere": true },
"sendAttributionRequest": true
"included": { "regions": ["tr"] },
"default": "yes"
}, {
"included": { "everywhere": true }
}]
},
{

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

@ -1,29 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
add_task(async function setup() {
Region._setHomeRegion("an", false);
await useTestEngines("test-extensions");
await AddonTestUtils.promiseStartupManager();
await Services.search.init();
});
add_task(async function test_send_attribution_request() {
let engine = await Services.search.getEngineByName("Plain");
Assert.ok(
engine.sendAttributionRequest,
"Should have noted to send the attribution request for Plain"
);
engine = await Services.search.getEngineByName("Special");
Assert.ok(
engine.sendAttributionRequest,
"Should have noted to send the attribution request for Special"
);
engine = await Services.search.getEngineByName("Multilocale AN");
Assert.ok(
!engine.sendAttributionRequest,
"Should not have noted to send the attribution request for Multilocale AN"
);
});

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

@ -67,7 +67,6 @@ support-files =
[test_bug930456_child.js]
skip-if = true # Is confusing
[test_bug930456.js]
[test_config_attribution.js]
[test_config_engine_params.js]
support-files =
method-extensions/get/manifest.json