зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1614777 - Part 4: Test cases; r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D64379 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
c9c0ef5deb
Коммит
68e6266159
|
@ -144,6 +144,34 @@ add_task(async function test_simple_search_page_visit() {
|
|||
);
|
||||
});
|
||||
|
||||
add_task(async function test_simple_search_page_visit_telemetry() {
|
||||
searchCounts.clear();
|
||||
Services.telemetry.clearScalars();
|
||||
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{
|
||||
gBrowser,
|
||||
/* URL must not be in the cache */
|
||||
url: getSERPUrl(getPageUrl(false, true)),
|
||||
},
|
||||
async () => {
|
||||
let scalars = {};
|
||||
const key = "browser.search.data_transferred";
|
||||
|
||||
await TestUtils.waitForCondition(() => {
|
||||
scalars =
|
||||
Services.telemetry.getSnapshotForKeyedScalars("main", false).parent ||
|
||||
{};
|
||||
return key in scalars;
|
||||
}, "should have the expected keyed scalars");
|
||||
|
||||
const scalar = scalars[key];
|
||||
Assert.ok("example" in scalar, "correct telemetry category");
|
||||
Assert.notEqual(scalars[key].example, 0, "bandwidth logged");
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
add_task(async function test_follow_on_visit() {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{
|
||||
|
|
|
@ -147,6 +147,26 @@ add_task(async function simple_remote_no_local_result() {
|
|||
Assert.equal(result.remote[2], "mom");
|
||||
});
|
||||
|
||||
add_task(async function simple_remote_no_local_result_telemetry() {
|
||||
Services.telemetry.clearScalars();
|
||||
|
||||
let controller = new SearchSuggestionController();
|
||||
await controller.fetch("mo", false, getEngine);
|
||||
|
||||
let scalars = {};
|
||||
const key = "browser.search.data_transferred";
|
||||
|
||||
await TestUtils.waitForCondition(() => {
|
||||
scalars =
|
||||
Services.telemetry.getSnapshotForKeyedScalars("main", false).parent || {};
|
||||
return key in scalars;
|
||||
}, "should have the expected keyed scalars");
|
||||
|
||||
const scalar = scalars[key];
|
||||
Assert.ok("sggt-other" in scalar, "correct telemetry category");
|
||||
Assert.notEqual(scalar["sggt-other"], 0, "bandwidth logged");
|
||||
});
|
||||
|
||||
add_task(async function simple_remote_no_local_result_alternative_type() {
|
||||
let controller = new SearchSuggestionController();
|
||||
let result = await controller.fetch("mo", false, alternateJSONEngine);
|
||||
|
|
Загрузка…
Ссылка в новой задаче