Bug 1671502 - Ensure tipShownCount.tabToSearch does not exceed tabToSearch.onboard.maxShown in browser_UsageTelemetry_urlbar_searchmode.js. r=adw

Differential Revision: https://phabricator.services.mozilla.com/D95207
This commit is contained in:
Harry Twyford 2020-11-02 15:06:55 +00:00
Родитель 9fbd3ff6c4
Коммит d77c6c3700
1 изменённых файлов: 10 добавлений и 2 удалений

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

@ -68,6 +68,9 @@ add_task(async function setup() {
["browser.urlbar.update2", true], ["browser.urlbar.update2", true],
["browser.urlbar.update2.localOneOffs", true], ["browser.urlbar.update2.localOneOffs", true],
["browser.urlbar.update2.oneOffsRefresh", true], ["browser.urlbar.update2.oneOffsRefresh", true],
// Disable tab-to-search onboarding results for general tests. They are
// enabled in tests that specifically address onboarding.
["browser.urlbar.tabToSearch.onboard.maxShown", 0],
], ],
}); });
@ -491,8 +494,12 @@ add_task(async function test_tabtosearch() {
// Enters search mode by selecting a tab-to-search onboarding result. // Enters search mode by selecting a tab-to-search onboarding result.
add_task(async function test_tabtosearch_onboard() { add_task(async function test_tabtosearch_onboard() {
await SpecialPowers.pushPrefEnv({ await SpecialPowers.pushPrefEnv({
set: [["browser.urlbar.update2.tabToComplete", true]], set: [
["browser.urlbar.update2.tabToComplete", true],
["browser.urlbar.tabToSearch.onboard.maxShown", 10],
],
}); });
UrlbarPrefs.set("tipShownCount.tabToSearch", 0);
UrlbarProviderTabToSearch.onboardingResultsThisSession = 0; UrlbarProviderTabToSearch.onboardingResultsThisSession = 0;
await PlacesTestUtils.addVisits([`https://${ENGINE_DOMAIN}/`]); await PlacesTestUtils.addVisits([`https://${ENGINE_DOMAIN}/`]);
@ -540,7 +547,8 @@ add_task(async function test_tabtosearch_onboard() {
await UrlbarTestUtils.exitSearchMode(window); await UrlbarTestUtils.exitSearchMode(window);
await UrlbarTestUtils.promisePopupClose(window); await UrlbarTestUtils.promisePopupClose(window);
UrlbarProviderTabToSearch.onboardingResultCountThisSession = 0;
UrlbarPrefs.set("tipShownCount.tabToSearch", 0);
await PlacesUtils.history.clear(); await PlacesUtils.history.clear();
await SpecialPowers.popPrefEnv(); await SpecialPowers.popPrefEnv();
}); });