зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1361661 - Part 5: Fix browser_UsageTelemetry_*.js tests. r=dexter
This commit is contained in:
Родитель
2c797655d6
Коммит
5003fda569
|
@ -81,7 +81,7 @@ add_task(async function test_context_menu() {
|
|||
|
||||
// Also check events.
|
||||
let events = Services.telemetry.snapshotBuiltinEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
|
||||
events = (events.default || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
checkEvents(events, [["navigation", "search", "contextmenu", null, {engine: "other-MozSearch"}]]);
|
||||
|
||||
contextMenu.hidePopup();
|
||||
|
@ -117,7 +117,7 @@ add_task(async function test_about_newtab() {
|
|||
|
||||
// Also check events.
|
||||
let events = Services.telemetry.snapshotBuiltinEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
|
||||
events = (events.default || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
checkEvents(events, [["navigation", "search", "about_newtab", "enter", {engine: "other-MozSearch"}]]);
|
||||
|
||||
await BrowserTestUtils.removeTab(tab);
|
||||
|
|
|
@ -81,7 +81,7 @@ add_task(async function test_abouthome_simpleQuery() {
|
|||
|
||||
// Also check events.
|
||||
let events = Services.telemetry.snapshotBuiltinEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
|
||||
events = (events.default || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
checkEvents(events, [["navigation", "search", "about_home", "enter", {engine: "other-MozSearch"}]]);
|
||||
|
||||
await BrowserTestUtils.removeTab(tab);
|
||||
|
|
|
@ -129,7 +129,7 @@ add_task(async function test_plainQuery() {
|
|||
|
||||
// Also check events.
|
||||
let events = Services.telemetry.snapshotBuiltinEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
|
||||
events = (events.default || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
checkEvents(events, [["navigation", "search", "searchbar", "enter", {engine: "other-MozSearch"}]]);
|
||||
|
||||
// Check the histograms as well.
|
||||
|
@ -173,7 +173,7 @@ add_task(async function test_oneOff_enter() {
|
|||
|
||||
// Also check events.
|
||||
let events = Services.telemetry.snapshotBuiltinEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
|
||||
events = (events.default || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
checkEvents(events, [["navigation", "search", "searchbar", "oneoff", {engine: "other-MozSearch2"}]]);
|
||||
|
||||
// Check the histograms as well.
|
||||
|
@ -298,7 +298,7 @@ add_task(async function test_suggestion_click() {
|
|||
|
||||
// Also check events.
|
||||
let events = Services.telemetry.snapshotBuiltinEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
|
||||
events = (events.default || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
checkEvents(events, [["navigation", "search", "searchbar", "suggestion", {engine: searchEngineId}]]);
|
||||
|
||||
// Check the histograms as well.
|
||||
|
|
|
@ -138,7 +138,7 @@ add_task(async function test_simpleQuery() {
|
|||
|
||||
// Also check events.
|
||||
let events = Services.telemetry.snapshotBuiltinEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
|
||||
events = (events.default || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
checkEvents(events, [["navigation", "search", "urlbar", "enter", {engine: "other-MozSearch"}]]);
|
||||
|
||||
// Check the histograms as well.
|
||||
|
@ -197,7 +197,7 @@ add_task(async function test_searchAlias() {
|
|||
|
||||
// Also check events.
|
||||
let events = Services.telemetry.snapshotBuiltinEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
|
||||
events = (events.default || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
checkEvents(events, [["navigation", "search", "urlbar", "alias", {engine: "other-MozSearch"}]]);
|
||||
|
||||
// Check the histograms as well.
|
||||
|
@ -261,7 +261,7 @@ add_task(async function test_oneOff_enter() {
|
|||
|
||||
// Also check events.
|
||||
let events = Services.telemetry.snapshotBuiltinEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
|
||||
events = (events.default || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
checkEvents(events, [["navigation", "search", "urlbar", "oneoff", {engine: "other-MozSearch"}]]);
|
||||
|
||||
// Check the histograms as well.
|
||||
|
@ -408,7 +408,7 @@ add_task(async function test_suggestion_click() {
|
|||
|
||||
// Also check events.
|
||||
let events = Services.telemetry.snapshotBuiltinEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false);
|
||||
events = (events.default || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
events = (events.parent || []).filter(e => e[1] == "navigation" && e[2] == "search");
|
||||
checkEvents(events, [["navigation", "search", "urlbar", "suggestion", {engine: searchEngineId}]]);
|
||||
|
||||
// Check the histograms as well.
|
||||
|
|
|
@ -100,8 +100,8 @@ function checkKeyedHistogram(h, key, expectedValue) {
|
|||
*/
|
||||
function getParentProcessScalars(aChannel, aKeyed = false, aClear = false) {
|
||||
const scalars = aKeyed ?
|
||||
Services.telemetry.snapshotKeyedScalars(aChannel, aClear)["default"] :
|
||||
Services.telemetry.snapshotScalars(aChannel, aClear)["default"];
|
||||
Services.telemetry.snapshotKeyedScalars(aChannel, aClear)["parent"] :
|
||||
Services.telemetry.snapshotScalars(aChannel, aClear)["parent"];
|
||||
return scalars || {};
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче