--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1731,17 +1731,16 @@ pref("urlclassifier.downloadAllowTable",
pref("urlclassifier.downloadBlockTable", "goog-badbinurl-proto");
pref("browser.suppress_first_window_animation", true);
// Preferences for Photon onboarding system extension
pref("browser.onboarding.enabled", true);
// Mark this as an upgraded profile so we don't offer the initial new user onboarding tour.
pref("browser.onboarding.tourset-version", 2);
-pref("browser.onboarding.hidden", false);
// On the Activity-Stream page, the snippet's position overlaps with our notification.
// So use `browser.onboarding.notification.finished` to let the AS page know
// if our notification is finished and safe to show their snippet.
pref("browser.onboarding.notification.finished", false);
pref("browser.onboarding.notification.mute-duration-on-first-session-ms", 300000); // 5 mins
pref("browser.onboarding.notification.max-life-time-per-tour-ms", 432000000); // 5 days
pref("browser.onboarding.notification.max-prompt-count-per-tour", 8);
pref("browser.onboarding.newtour", "performance,private,screenshots,addons,customize,default");
--- a/browser/extensions/onboarding/OnboardingTourType.jsm
+++ b/browser/extensions/onboarding/OnboardingTourType.jsm
@@ -27,17 +27,16 @@ var OnboardingTourType = {
const TOURSET_VERSION = Services.prefs.getIntPref("browser.onboarding.tourset-version");
if (!Services.prefs.prefHasUserValue(PREF_SEEN_TOURSET_VERSION)) {
// User has never seen an onboarding tour, present the user with the new user tour.
Services.prefs.setStringPref(PREF_TOUR_TYPE, "new");
} else if (Services.prefs.getIntPref(PREF_SEEN_TOURSET_VERSION) < TOURSET_VERSION) {
// show the update user tour when tour set version is larger than the seen tourset version
Services.prefs.setStringPref(PREF_TOUR_TYPE, "update");
- Services.prefs.setBoolPref("browser.onboarding.hidden", false);
// Reset all the notification-related prefs because tours update.
Services.prefs.setBoolPref("browser.onboarding.notification.finished", false);
Services.prefs.clearUserPref("browser.onboarding.notification.prompt-count");
Services.prefs.clearUserPref("browser.onboarding.notification.last-time-of-changing-tour-sec");
Services.prefs.clearUserPref("browser.onboarding.notification.tour-ids-queue");
}
Services.prefs.setIntPref(PREF_SEEN_TOURSET_VERSION, TOURSET_VERSION);
},
--- a/browser/extensions/onboarding/README.md
+++ b/browser/extensions/onboarding/README.md
@@ -3,17 +3,16 @@
System addon to provide the onboarding overlay for user-friendly tours.
## How to show the onboarding tour
Open `about:config` page and filter with `onboarding` keyword. Then set following preferences:
```
browser.onboarding.disabled = false
-browser.onboarding.hidden = false
browser.onboarding.tour-set = "new" // for new user tour, or "update" for update user tour
```
And make sure the value of `browser.onboarding.tourset-verion` and `browser.onboarding.seen-tourset-verion` are the same.
## How to show the onboarding notification
Besides above settings, notification will wait 5 minutes before showing the first notification on a new profile or the updated user profile (to not put too much information to the user at once).
--- a/browser/extensions/onboarding/bootstrap.js
+++ b/browser/extensions/onboarding/bootstrap.js
@@ -15,17 +15,16 @@ XPCOMUtils.defineLazyModuleGetter(this,
"resource://gre/modules/FxAccounts.jsm");
const {PREF_STRING, PREF_BOOL, PREF_INT} = Ci.nsIPrefBranch;
const BROWSER_READY_NOTIFICATION = "browser-delayed-startup-finished";
const BROWSER_SESSION_STORE_NOTIFICATION = "sessionstore-windows-restored";
const PREF_WHITELIST = [
["browser.onboarding.enabled", PREF_BOOL],
- ["browser.onboarding.hidden", PREF_BOOL],
["browser.onboarding.notification.finished", PREF_BOOL],
["browser.onboarding.notification.prompt-count", PREF_INT],
["browser.onboarding.notification.last-time-of-changing-tour-sec", PREF_INT],
["browser.onboarding.notification.tour-ids-queue", PREF_STRING],
];
[
"onboarding-tour-addons",
@@ -43,17 +42,17 @@ let waitingForBrowserReady = true;
/**
* Set pref. Why no `getPrefs` function is due to the priviledge level.
* We cannot set prefs inside a framescript but can read.
* For simplicity and effeciency, we still read prefs inside the framescript.
*
* @param {Array} prefs the array of prefs to set.
* The array element carrys info to set pref, should contain
- * - {String} name the pref name, such as `browser.onboarding.hidden`
+ * - {String} name the pref name
* - {*} value the value to set
**/
function setPrefs(prefs) {
prefs.forEach(pref => {
let prefObj = PREF_WHITELIST.find(([name, ]) => name == pref.name);
if (!prefObj) {
return;
}
--- a/browser/extensions/onboarding/content/onboarding.css
+++ b/browser/extensions/onboarding/content/onboarding.css
@@ -156,24 +156,23 @@
margin-top: 40px;
margin-bottom: 0;
margin-inline-end: 0;
margin-inline-start: 0;
padding: 0;
}
#onboarding-overlay-dialog > footer {
- grid-row: footer-start;
grid-column: dialog-start / tour-end;
font-size: 13px;
}
-#onboarding-tour-hidden-checkbox {
+#onboarding-skip-tour-button {
margin-inline-start: 27px;
- margin-inline-end: 10px;
+ margin-bottom: 27px;
}
/* Onboarding tour list */
#onboarding-tour-list {
margin: 40px 0 0 0;
padding: 0;
margin-inline-start: 16px;
}
@@ -315,16 +314,18 @@
}
.onboarding-tour-page.onboarding-no-button > .onboarding-tour-content {
grid-row: tour-page-start / tour-page-end;
grid-column: tour-content-start / tour-page-end;
}
.onboarding-tour-button-container {
+ /* Get higher z-index in order to ensure buttons within container are selectable */
+ z-index: 2;
grid-row: tour-button-start / tour-page-end;
grid-column: tour-content-start / tour-page-end;
}
.onboarding-tour-page.onboarding-no-button > .onboarding-tour-button-container {
display: none;
grid-row: tour-page-end;
grid-column: tour-page-end;
@@ -341,24 +342,24 @@
line-height: 16px;
color: #fff;
float: inline-end;
margin-inline-end: 26px;
margin-top: -32px;
}
/* Remove default dotted outline around buttons' text */
-.onboarding-tour-action-button::-moz-focus-inner,
+#onboarding-overlay button::-moz-focus-inner,
#onboarding-overlay-button::-moz-focus-inner {
border: 0;
}
/* Keyboard focus specific outline */
-.onboarding-tour-action-button:-moz-focusring,
-#onboarding-notification-action-btn:-moz-focusring,
+#onboarding-overlay button:-moz-focusring,
+.onboarding-action-button:-moz-focusring,
#onboarding-tour-list .onboarding-tour-item:focus {
outline: 2px solid rgba(0,149,221,0.5);
outline-offset: 1px;
-moz-outline-radius: 2px;
}
.onboarding-tour-action-button:hover:not([disabled]) {
background: #003eaa;
@@ -547,35 +548,35 @@ a#onboarding-tour-screenshots-button:vis
#onboarding-notification-tour-icon {
min-width: 64px;
height: 64px;
background-size: 64px;
background-repeat: no-repeat;
background-image: url("chrome://branding/content/icon64.png");
}
-#onboarding-notification-action-btn {
+.onboarding-action-button {
background: #fbfbfb;
/* With 1px border, could see a border in the high-constrast mode */
border: 1px solid #c1c1c1;
border-radius: 2px;
padding: 10px 20px;
font-size: 14px;
font-weight: 600;
line-height: 16px;
color: #202340;
min-width: 130px;
}
-#onboarding-notification-action-btn:hover {
+.onboarding-action-button:hover {
background-color: #ebebeb;
cursor: pointer;
}
-#onboarding-notification-action-btn:active {
+.onboarding-action-button:active {
background-color: #dadada;
}
@media (min-resolution: 2dppx) {
#onboarding-notification-tour-icon {
background-image: url("chrome://branding/content/icon128.png");
}
}
--- a/browser/extensions/onboarding/content/onboarding.js
+++ b/browser/extensions/onboarding/content/onboarding.js
@@ -447,21 +447,16 @@ class Onboarding {
}
_initPrefObserver() {
if (this._prefsObserved) {
return;
}
this._prefsObserved = new Map();
- this._prefsObserved.set("browser.onboarding.hidden", prefValue => {
- if (prefValue) {
- this.destroy();
- }
- });
this._tours.forEach(tour => {
let tourId = tour.id;
this._prefsObserved.set(`browser.onboarding.tour.${tourId}.completed`, () => {
this.markTourCompletionState(tourId);
});
});
for (let [name, callback] of this._prefsObserved) {
Services.prefs.addObserver(name, callback);
@@ -494,16 +489,21 @@ class Onboarding {
({ id, classList } = target.firstChild);
}
switch (id) {
case "onboarding-overlay-button":
this.showOverlay();
this.gotoPage(this._firstUncompleteTour.id);
break;
+ case "onboarding-skip-tour-button":
+ this.hideNotification();
+ this.hideOverlay();
+ this.skipTour();
+ break;
case "onboarding-overlay-close-btn":
// If the clicking target is directly on the outer-most overlay,
// that means clicking outside the tour content area.
// Let's toggle the overlay.
case "onboarding-overlay":
this.hideOverlay();
break;
case "onboarding-notification-close-btn":
@@ -661,20 +661,16 @@ class Onboarding {
this._loadTours(this._tours);
}
this.hideNotification();
this.toggleModal(this._overlay.classList.toggle("onboarding-opened"));
}
hideOverlay() {
- let hiddenCheckbox = this._window.document.getElementById("onboarding-tour-hidden-checkbox");
- if (hiddenCheckbox.checked) {
- this.hide();
- }
this.toggleModal(this._overlay.classList.toggle("onboarding-opened"));
}
/**
* Set modal dialog state and properties for accessibility purposes.
* @param {Boolean} opened whether the dialog is opened or closed.
*/
toggleModal(opened) {
@@ -980,35 +976,31 @@ class Onboarding {
// The security should be fine because this is not from an external input.
footer.innerHTML = `
<section id="onboarding-notification-message-section" role="presentation">
<div id="onboarding-notification-tour-icon" role="presentation"></div>
<div id="onboarding-notification-body" role="presentation">
<h1 id="onboarding-notification-tour-title"></h1>
<p id="onboarding-notification-tour-message"></p>
</div>
- <button id="onboarding-notification-action-btn"></button>
+ <button id="onboarding-notification-action-btn" class="onboarding-action-button"></button>
</section>
<button id="onboarding-notification-close-btn" class="onboarding-close-btn"></button>
`;
let closeBtn = footer.querySelector("#onboarding-notification-close-btn");
closeBtn.setAttribute("title",
this._bundle.GetStringFromName("onboarding.notification-close-button-tooltip"));
return footer;
}
- hide() {
+ skipTour() {
this.setToursCompleted(this._tours.map(tour => tour.id));
sendMessageToChrome("set-prefs", [
{
- name: "browser.onboarding.hidden",
- value: true
- },
- {
name: "browser.onboarding.notification.finished",
value: true
}
]);
}
_renderOverlay() {
let div = this._window.document.createElement("div");
@@ -1017,27 +1009,27 @@ class Onboarding {
// The security should be fine because this is not from an external input.
div.innerHTML = `
<div role="dialog" tabindex="-1" aria-labelledby="onboarding-header">
<header id="onboarding-header"></header>
<nav>
<ul id="onboarding-tour-list" role="tablist"></ul>
</nav>
<footer id="onboarding-footer">
- <input type="checkbox" id="onboarding-tour-hidden-checkbox" /><label for="onboarding-tour-hidden-checkbox"></label>
+ <button id="onboarding-skip-tour-button" class="onboarding-action-button"></button>
</footer>
<button id="onboarding-overlay-close-btn" class="onboarding-close-btn"></button>
</div>
`;
this._dialog = div.querySelector(`[role="dialog"]`);
this._dialog.id = ONBOARDING_DIALOG_ID;
- div.querySelector("label[for='onboarding-tour-hidden-checkbox']").textContent =
- this._bundle.GetStringFromName("onboarding.hidden-checkbox-label-text");
+ div.querySelector("#onboarding-skip-tour-button").textContent =
+ this._bundle.GetStringFromName("onboarding.skip-tour-button-label");
div.querySelector("#onboarding-header").textContent =
this._bundle.GetStringFromName("onboarding.overlay-title2");
let closeBtn = div.querySelector("#onboarding-overlay-close-btn");
closeBtn.setAttribute("title",
this._bundle.GetStringFromName("onboarding.overlay-close-button-tooltip"));
return div;
}
@@ -1141,25 +1133,23 @@ class Onboarding {
// Load onboarding module only when we enable it.
if (Services.prefs.getBoolPref("browser.onboarding.enabled", false)) {
addEventListener("load", function onLoad(evt) {
if (!content || evt.target != content.document) {
return;
}
- if (!Services.prefs.getBoolPref("browser.onboarding.hidden", false)) {
- let window = evt.target.defaultView;
- let location = window.location.href;
- if (location == ABOUT_NEWTAB_URL || location == ABOUT_HOME_URL) {
- // We just want to run tests as quick as possible
- // so in the automation test, we don't do `requestIdleCallback`.
- if (Cu.isInAutomation) {
- new Onboarding(window);
- return;
- }
- window.requestIdleCallback(() => {
- new Onboarding(window);
- });
+ let window = evt.target.defaultView;
+ let location = window.location.href;
+ if (location == ABOUT_NEWTAB_URL || location == ABOUT_HOME_URL) {
+ // We just want to run tests as quick as possible
+ // so in the automation test, we don't do `requestIdleCallback`.
+ if (Cu.isInAutomation) {
+ new Onboarding(window);
+ return;
}
+ window.requestIdleCallback(() => {
+ new Onboarding(window);
+ });
}
}, true);
}
--- a/browser/extensions/onboarding/locales/en-US/onboarding.properties
+++ b/browser/extensions/onboarding/locales/en-US/onboarding.properties
@@ -1,14 +1,14 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# LOCALIZATION NOTE(onboarding.overlay-title2): This string will be used in the overlay title.
onboarding.overlay-title2=Let’s get started
-onboarding.hidden-checkbox-label-text=Mark all as complete, and hide the tour
+onboarding.skip-tour-button-label=Skip Tour
#LOCALIZATION NOTE(onboarding.button.learnMore): this string is used as a button label, displayed near the message, and shared across all the onboarding notifications.
onboarding.button.learnMore=Learn More
# LOCALIZATION NOTE(onboarding.overlay-icon-tooltip2): This string will be used
# to show the tooltip alongside the notification icon in the overlay tour. %S is
# brandShortName. The tooltip is designed to show in two lines. Please use \n to
# do appropriate line breaking.
onboarding.overlay-icon-tooltip2=New to %S?\nLet’s get started.
# LOCALIZATION NOTE(onboarding.overlay-icon-tooltip-updated2): %S is
--- a/browser/extensions/onboarding/test/browser/browser.ini
+++ b/browser/extensions/onboarding/test/browser/browser.ini
@@ -1,16 +1,16 @@
[DEFAULT]
support-files =
head.js
[browser_onboarding_accessibility.js]
-[browser_onboarding_hide_all.js]
[browser_onboarding_keyboard.js]
skip-if = debug || os == "mac" # Full keyboard navigation on OSX only works if Full Keyboard Access setting is set to All Control in System Keyboard Preferences
[browser_onboarding_notification.js]
[browser_onboarding_notification_2.js]
[browser_onboarding_notification_3.js]
[browser_onboarding_notification_4.js]
[browser_onboarding_notification_click_auto_complete_tour.js]
[browser_onboarding_select_default_tour.js]
+[browser_onboarding_skip_tour.js]
[browser_onboarding_tours.js]
[browser_onboarding_tourset.js]
rename from browser/extensions/onboarding/test/browser/browser_onboarding_hide_all.js
rename to browser/extensions/onboarding/test/browser/browser_onboarding_skip_tour.js
--- a/browser/extensions/onboarding/test/browser/browser_onboarding_hide_all.js
+++ b/browser/extensions/onboarding/test/browser/browser_onboarding_skip_tour.js
@@ -1,84 +1,26 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
-function assertOnboardingDestroyed(browser) {
- return ContentTask.spawn(browser, {}, function() {
- let expectedRemovals = [
- "#onboarding-overlay",
- "#onboarding-overlay-button"
- ];
- for (let selector of expectedRemovals) {
- let removal = content.document.querySelector(selector);
- ok(!removal, `Should remove ${selector} onboarding element`);
- }
- });
-}
-
-add_task(async function test_hide_onboarding_tours() {
+add_task(async function test_skip_onboarding_tours() {
resetOnboardingDefaultState();
let tourIds = TOUR_IDs;
let expectedPrefUpdates = [
- promisePrefUpdated("browser.onboarding.hidden", true),
promisePrefUpdated("browser.onboarding.notification.finished", true)
];
tourIds.forEach((id, idx) => expectedPrefUpdates.push(promisePrefUpdated(`browser.onboarding.tour.${id}.completed`, true)));
- let tabs = [];
- for (let url of URLs) {
- let tab = await openTab(url);
- await promiseOnboardingOverlayLoaded(tab.linkedBrowser);
- await BrowserTestUtils.synthesizeMouseAtCenter("#onboarding-overlay-button", {}, tab.linkedBrowser);
- await promiseOnboardingOverlayOpened(tab.linkedBrowser);
- tabs.push(tab);
- }
-
- let doc = content.document;
- await BrowserTestUtils.synthesizeMouseAtCenter("#onboarding-tour-hidden-checkbox", {}, gBrowser.selectedBrowser);
- await BrowserTestUtils.synthesizeMouseAtCenter("#onboarding-overlay-close-btn", {}, gBrowser.selectedBrowser);
- await Promise.all(expectedPrefUpdates);
- ok(!doc.getElementById("onboarding-overlay-button"));
-
- for (let i = tabs.length - 1; i >= 0; --i) {
- let tab = tabs[i];
- await assertOnboardingDestroyed(tab.linkedBrowser);
- await BrowserTestUtils.removeTab(tab);
- }
-});
-
-add_task(async function test_refresh_onboarding_tours_after_hide() {
- resetOnboardingDefaultState();
+ let tab = await openTab(ABOUT_NEWTAB_URL);
+ await promiseOnboardingOverlayLoaded(tab.linkedBrowser);
+ await BrowserTestUtils.synthesizeMouseAtCenter("#onboarding-overlay-button", {}, tab.linkedBrowser);
+ await promiseOnboardingOverlayOpened(tab.linkedBrowser);
- let tourIds = TOUR_IDs;
- let expectedPrefUpdates = [
- promisePrefUpdated("browser.onboarding.hidden", true),
- promisePrefUpdated("browser.onboarding.notification.finished", true)
- ];
- tourIds.forEach((id, idx) => expectedPrefUpdates.push(promisePrefUpdated(`browser.onboarding.tour.${id}.completed`, true)));
-
- let tabs = [];
- for (let url of URLs) {
- let tab = await openTab(url);
- await promiseOnboardingOverlayLoaded(tab.linkedBrowser);
- await BrowserTestUtils.synthesizeMouseAtCenter("#onboarding-overlay-button", {}, tab.linkedBrowser);
- await promiseOnboardingOverlayOpened(tab.linkedBrowser);
- tabs.push(tab);
- }
+ let overlayClosedPromise = promiseOnboardingOverlayClosed(tab.linkedBrowser);
+ await BrowserTestUtils.synthesizeMouseAtCenter("#onboarding-skip-tour-button", {}, tab.linkedBrowser);
+ await overlayClosedPromise;
+ await Promise.all(expectedPrefUpdates);
- await BrowserTestUtils.synthesizeMouseAtCenter("#onboarding-tour-hidden-checkbox", {}, gBrowser.selectedBrowser);
- await BrowserTestUtils.synthesizeMouseAtCenter("#onboarding-overlay-close-btn", {}, gBrowser.selectedBrowser);
- await Promise.all(expectedPrefUpdates);
- ok(!content.document.getElementById("onboarding-overlay-button"), "should not show fox icon");
-
- for (let i = tabs.length - 1; i >= 0; --i) {
- let tab = tabs[i];
- await reloadTab(tab);
- await waitUntilWindowIdle(tab.linkedBrowser);
- ok(!content.document.getElementById("onboarding-overlay-button"), "should not show fox icon after refresh");
-
- await assertOnboardingDestroyed(tab.linkedBrowser);
- await BrowserTestUtils.removeTab(tab);
- }
+ await BrowserTestUtils.removeTab(tab);
});
--- a/browser/extensions/onboarding/test/browser/head.js
+++ b/browser/extensions/onboarding/test/browser/head.js
@@ -24,17 +24,16 @@ const UPDATE_TOUR_IDs = [
];
registerCleanupFunction(resetOnboardingDefaultState);
function resetOnboardingDefaultState() {
// All the prefs should be reset to the default states
// and no need to revert back so we don't use `SpecialPowers.pushPrefEnv` here.
Preferences.set("browser.onboarding.enabled", true);
- Preferences.set("browser.onboarding.hidden", false);
Preferences.set("browser.onboarding.notification.finished", false);
Preferences.set("browser.onboarding.notification.mute-duration-on-first-session-ms", 300000);
Preferences.set("browser.onboarding.notification.max-life-time-per-tour-ms", 432000000);
Preferences.set("browser.onboarding.notification.max-prompt-count-per-tour", 8);
Preferences.reset("browser.onboarding.notification.last-time-of-changing-tour-sec");
Preferences.reset("browser.onboarding.notification.prompt-count");
Preferences.reset("browser.onboarding.notification.tour-ids-queue");
TOUR_IDs.forEach(id => Preferences.reset(`browser.onboarding.tour.${id}.completed`));
--- a/browser/extensions/onboarding/test/unit/head.js
+++ b/browser/extensions/onboarding/test/unit/head.js
@@ -23,25 +23,22 @@ if (!extensionDir.exists()) {
}
Components.manager.addBootstrappedManifestLocation(extensionDir);
const TOURSET_VERSION = 1;
const NEXT_TOURSET_VERSION = 2;
const PREF_TOUR_TYPE = "browser.onboarding.tour-type";
const PREF_TOURSET_VERSION = "browser.onboarding.tourset-version";
const PREF_SEEN_TOURSET_VERSION = "browser.onboarding.seen-tourset-version";
-const PREF_ONBOARDING_HIDDEN = "browser.onboarding.hidden";
function resetOnboardingDefaultState() {
// All the prefs should be reset to what prefs should looks like in a new user profile
- Services.prefs.setBoolPref(PREF_ONBOARDING_HIDDEN, false);
Services.prefs.setIntPref(PREF_TOURSET_VERSION, TOURSET_VERSION);
Services.prefs.clearUserPref(PREF_SEEN_TOURSET_VERSION);
Services.prefs.clearUserPref(PREF_TOUR_TYPE);
}
function resetOldProfileDefaultState() {
// All the prefs should be reset to what prefs should looks like in a older new user profile
Services.prefs.setIntPref(PREF_TOURSET_VERSION, TOURSET_VERSION);
Services.prefs.setIntPref(PREF_SEEN_TOURSET_VERSION, 0);
- Services.prefs.clearUserPref(PREF_ONBOARDING_HIDDEN);
Services.prefs.clearUserPref(PREF_TOUR_TYPE);
}
--- a/browser/extensions/onboarding/test/unit/test-onboarding-tour-type.js
+++ b/browser/extensions/onboarding/test/unit/test-onboarding-tour-type.js
@@ -11,89 +11,79 @@ add_task(async function() {
resetOnboardingDefaultState();
OnboardingTourType.check();
do_check_eq(Preferences.get(PREF_TOUR_TYPE), "new", "should show the new user tour");
do_check_eq(Preferences.get(PREF_TOURSET_VERSION), TOURSET_VERSION,
"tourset version should not change");
do_check_eq(Preferences.get(PREF_SEEN_TOURSET_VERSION), TOURSET_VERSION,
"seen tourset version should be set as the tourset version");
- do_check_eq(Preferences.get(PREF_ONBOARDING_HIDDEN), false, "should show the user tour");
});
add_task(async function() {
do_print("Starting testcase: When New user restart the browser");
resetOnboardingDefaultState();
Preferences.set(PREF_TOUR_TYPE, "new");
Preferences.set(PREF_SEEN_TOURSET_VERSION, TOURSET_VERSION);
- Preferences.set(PREF_ONBOARDING_HIDDEN, false);
OnboardingTourType.check();
do_check_eq(Preferences.get(PREF_TOUR_TYPE), "new", "should show the new user tour");
do_check_eq(Preferences.get(PREF_TOURSET_VERSION), TOURSET_VERSION),
"tourset version should not change";
do_check_eq(Preferences.get(PREF_SEEN_TOURSET_VERSION), TOURSET_VERSION,
"seen tourset version should be set as the tourset version");
- do_check_eq(Preferences.get(PREF_ONBOARDING_HIDDEN), false, "should show the user tour");
});
add_task(async function() {
do_print("Starting testcase: When New User choosed to hide the overlay and restart the browser");
resetOnboardingDefaultState();
Preferences.set(PREF_TOUR_TYPE, "new");
Preferences.set(PREF_SEEN_TOURSET_VERSION, TOURSET_VERSION);
- Preferences.set(PREF_ONBOARDING_HIDDEN, true);
OnboardingTourType.check();
do_check_eq(Preferences.get(PREF_TOUR_TYPE), "new", "should show the new user tour");
do_check_eq(Preferences.get(PREF_TOURSET_VERSION), TOURSET_VERSION),
"tourset version should not change";
do_check_eq(Preferences.get(PREF_SEEN_TOURSET_VERSION), TOURSET_VERSION,
"seen tourset version should be set as the tourset version");
- do_check_eq(Preferences.get(PREF_ONBOARDING_HIDDEN), true, "should hide the user tour");
});
add_task(async function() {
do_print("Starting testcase: When New User updated to the next major version and restart the browser");
resetOnboardingDefaultState();
Preferences.set(PREF_TOURSET_VERSION, NEXT_TOURSET_VERSION);
Preferences.set(PREF_TOUR_TYPE, "new");
Preferences.set(PREF_SEEN_TOURSET_VERSION, TOURSET_VERSION);
- Preferences.set(PREF_ONBOARDING_HIDDEN, false);
OnboardingTourType.check();
do_check_eq(Preferences.get(PREF_TOUR_TYPE), "update", "should show the update user tour");
do_check_eq(Preferences.get(PREF_TOURSET_VERSION), NEXT_TOURSET_VERSION),
"tourset version should not change";
do_check_eq(Preferences.get(PREF_SEEN_TOURSET_VERSION), NEXT_TOURSET_VERSION,
"seen tourset version should be set as the tourset version");
- do_check_eq(Preferences.get(PREF_ONBOARDING_HIDDEN), false, "should show the user tour");
});
add_task(async function() {
do_print("Starting testcase: When New User prefer hide the tour, then updated to the next major version and restart the browser");
resetOnboardingDefaultState();
Preferences.set(PREF_TOURSET_VERSION, NEXT_TOURSET_VERSION);
Preferences.set(PREF_TOUR_TYPE, "new");
Preferences.set(PREF_SEEN_TOURSET_VERSION, TOURSET_VERSION);
- Preferences.set(PREF_ONBOARDING_HIDDEN, true);
OnboardingTourType.check();
do_check_eq(Preferences.get(PREF_TOUR_TYPE), "update", "should show the update user tour");
do_check_eq(Preferences.get(PREF_TOURSET_VERSION), NEXT_TOURSET_VERSION),
"tourset version should not change";
do_check_eq(Preferences.get(PREF_SEEN_TOURSET_VERSION), NEXT_TOURSET_VERSION,
"seen tourset version should be set as the tourset version");
- do_check_eq(Preferences.get(PREF_ONBOARDING_HIDDEN), false, "should show the user tour");
});
add_task(async function() {
do_print("Starting testcase: When User update from browser version < 56");
resetOldProfileDefaultState();
OnboardingTourType.check();
do_check_eq(Preferences.get(PREF_TOUR_TYPE), "update", "should show the update user tour");
do_check_eq(Preferences.get(PREF_TOURSET_VERSION), TOURSET_VERSION),
"tourset version should not change";
do_check_eq(Preferences.get(PREF_SEEN_TOURSET_VERSION), TOURSET_VERSION,
"seen tourset version should be set as the tourset version");
- do_check_eq(Preferences.get(PREF_ONBOARDING_HIDDEN), false, "should show the user tour");
});