Skip to content

Commit 381e246

Browse files
committed
Backed out changeset 6aab4af4cab8 (bug 1864534) for causing failures in browser_syncedtabs_firefoxview_next.js CLOSED TREE
1 parent 835b4b8 commit 381e246

18 files changed

+102
-41
lines changed

browser/app/profile/firefox.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,7 @@ pref("browser.tabs.tooltipsShowPidAndActiveness", false);
908908
#endif
909909

910910
pref("browser.tabs.firefox-view", true);
911+
pref("browser.tabs.firefox-view-next", true);
911912
pref("browser.tabs.firefox-view-newIcon", true);
912913
pref("browser.tabs.firefox-view.logLevel", "Warn");
913914
pref("browser.tabs.firefox-view.notify-for-tabs", false);

browser/base/content/browser.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ var gInitialPages = [
718718
"about:blank",
719719
"about:home",
720720
"about:firefoxview",
721+
"about:firefoxview-next",
721722
"about:newtab",
722723
"about:privatebrowsing",
723724
"about:sessionrestore",
@@ -9966,6 +9967,7 @@ var FirefoxViewHandler = {
99669967
this._updateEnabledState = this._updateEnabledState.bind(this);
99679968
this._updateEnabledState();
99689969
NimbusFeatures.majorRelease2022.onUpdate(this._updateEnabledState);
9970+
NimbusFeatures.firefoxViewNext.onUpdate(this._updateEnabledState);
99699971

99709972
ChromeUtils.defineESModuleGetters(this, {
99719973
SyncedTabs: "resource://services-sync/SyncedTabs.sys.mjs",
@@ -9976,9 +9978,12 @@ var FirefoxViewHandler = {
99769978
CustomizableUI.removeListener(this);
99779979
Services.obs.removeObserver(this, "firefoxview-notification-dot-update");
99789980
NimbusFeatures.majorRelease2022.offUpdate(this._updateEnabledState);
9981+
NimbusFeatures.firefoxViewNext.offUpdate(this._updateEnabledState);
99799982
},
99809983
_updateEnabledState() {
9981-
this._enabled = NimbusFeatures.majorRelease2022.getVariable("firefoxView");
9984+
this._enabled =
9985+
NimbusFeatures.majorRelease2022.getVariable("firefoxView") ||
9986+
NimbusFeatures.firefoxViewNext.getVariable("enabled");
99829987
// We use a root attribute because there's no guarantee the button is in the
99839988
// DOM, and visibility changes need to take effect even if it isn't in the DOM
99849989
// right now.
@@ -10013,7 +10018,9 @@ var FirefoxViewHandler = {
1001310018
CustomizableUI.getPlacementOfWidget("tabbrowser-tabs").position
1001410019
);
1001510020
}
10016-
const viewURL = "about:firefoxview";
10021+
const viewURL = NimbusFeatures.firefoxViewNext.getVariable("enabled")
10022+
? "about:firefoxview-next"
10023+
: "about:firefoxview";
1001710024
// Need to account for navigation to Firefox View pages
1001810025
if (
1001910026
this.tab &&
@@ -10108,11 +10115,18 @@ var FirefoxViewHandler = {
1010810115
const PREF_NAME = "browser.firefox-view.view-count";
1010910116
const MAX_VIEW_COUNT = 10;
1011010117
let viewCount = Services.prefs.getIntPref(PREF_NAME, 0);
10118+
let isFirefoxViewNext = Services.prefs.getBoolPref(
10119+
"browser.tabs.firefox-view-next",
10120+
false
10121+
);
1011110122

1011210123
// Record telemetry
10113-
Services.telemetry.setEventRecordingEnabled("firefoxview_next", true);
10124+
Services.telemetry.setEventRecordingEnabled(
10125+
isFirefoxViewNext ? "firefoxview_next" : "firefoxview",
10126+
true
10127+
);
1011410128
Services.telemetry.recordEvent(
10115-
"firefoxview_next",
10129+
isFirefoxViewNext ? "firefoxview_next" : "firefoxview",
1011610130
"tab_selected",
1011710131
"toolbarbutton",
1011810132
null,

browser/base/content/test/static/browser_all_files_referenced.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,6 @@ var allowlist = [
282282
{ file: "chrome://browser/content/screenshots/copy.svg" },
283283
{ file: "chrome://browser/content/screenshots/download.svg" },
284284
{ file: "chrome://browser/content/screenshots/download-white.svg" },
285-
286-
// Files removed in child patch for Bug 1869833
287-
{ file: "chrome://browser/content/firefoxview/firefoxview.css" },
288-
{ file: "chrome://browser/content/firefoxview/firefoxview.html" },
289-
{ file: "chrome://browser/content/firefoxview/firefoxview.mjs" },
290-
{ file: "chrome://browser/content/firefoxview/recently-closed-empty.svg" },
291-
{ file: "chrome://browser/content/firefoxview/recently-closed-tabs.mjs" },
292-
{ file: "chrome://browser/content/firefoxview/tab-pickup-container.mjs" },
293-
{ file: "chrome://browser/content/firefoxview/tab-pickup-empty.svg" },
294-
{ file: "chrome://browser/content/firefoxview/tab-pickup-list.mjs" },
295285
];
296286

297287
if (AppConstants.platform != "win") {

browser/components/BrowserGlue.sys.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ let JSWINDOWACTORS = {
588588
"chrome://browser/content/places/historySidebar.xhtml",
589589
"chrome://browser/content/places/bookmarksSidebar.xhtml",
590590
"about:firefoxview",
591+
"about:firefoxview-next",
591592
],
592593
},
593594

browser/components/about/AboutRedirector.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ static const RedirEntry kRedirMap[] = {
7474
nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
7575
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
7676
nsIAboutModule::IS_SECURE_CHROME_UI},
77-
{"firefoxview",
77+
{"firefoxview", "chrome://browser/content/firefoxview/firefoxview.html",
78+
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI |
79+
nsIAboutModule::HIDE_FROM_ABOUTABOUT},
80+
{"firefoxview-next",
7881
"chrome://browser/content/firefoxview/firefoxview-next.html",
7982
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI |
8083
nsIAboutModule::HIDE_FROM_ABOUTABOUT},

browser/components/firefoxview/card-container.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class CardContainer extends MozLitElement {
154154
<slot name="secondary-header"></slot>
155155
</span>
156156
<a
157-
href="about:firefoxview#${this.shortPageName}"
157+
href="about:firefoxview-next#${this.shortPageName}"
158158
@click=${this.viewAllClicked}
159159
class="view-all-link"
160160
data-l10n-id="firefoxview-view-all-link"
@@ -188,7 +188,7 @@ class CardContainer extends MozLitElement {
188188
<slot name="header"></slot>
189189
</summary>
190190
<a
191-
href="about:firefoxview#${this.shortPageName}"
191+
href="about:firefoxview-next#${this.shortPageName}"
192192
@click=${this.viewAllClicked}
193193
class="view-all-link"
194194
data-l10n-id="firefoxview-view-all-link"

browser/components/firefoxview/recentlyclosed.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ class RecentlyClosedTabsInView extends ViewPage {
306306
"firefoxview-recentlyclosed-empty-description-two",
307307
];
308308
descriptionLink = {
309-
url: "about:firefoxview#history",
309+
url: "about:firefoxview-next#history",
310310
name: "history-url",
311311
sameTarget: "true",
312312
};

browser/components/firefoxview/tests/browser/FirefoxViewTestUtils.sys.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ function init(scope) {
1818
}
1919

2020
function getFirefoxViewURL() {
21-
return "about:firefoxview";
21+
return Services.prefs.getBoolPref("browser.tabs.firefox-view-next", true)
22+
? "about:firefoxview-next"
23+
: "about:firefoxview";
2224
}
2325

2426
function assertFirefoxViewTab(win) {

browser/components/firefoxview/tests/browser/firefoxview-next/browser_firefoxview_next.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,36 @@
33

44
/* import-globals-from ../head.js */
55

6+
const FXVIEW_NEXT_ENABLED_PREF = "browser.tabs.firefox-view-next";
67
const FXVIEW_ENABLED_PREF = "browser.tabs.firefox-view";
78

8-
add_task(async function test_aria_roles() {
9+
add_task(async function about_firefoxview_next_pref() {
10+
// Verify pref enables new Firefox view
11+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_NEXT_ENABLED_PREF, true]] });
12+
await withFirefoxView({}, async browser => {
13+
const { document } = browser.contentWindow;
14+
is(document.location.href, "about:firefoxview-next");
15+
});
16+
// Verify pref enables new Firefox view even when old is disabled
17+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_ENABLED_PREF, false]] });
18+
await withFirefoxView({}, async browser => {
19+
const { document } = browser.contentWindow;
20+
is(document.location.href, "about:firefoxview-next");
21+
});
22+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_ENABLED_PREF, true]] });
23+
// Verify pref disables new Firefox view
24+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_NEXT_ENABLED_PREF, false]] });
925
await withFirefoxView({}, async browser => {
1026
const { document } = browser.contentWindow;
1127
is(document.location.href, "about:firefoxview");
28+
});
29+
});
30+
31+
add_task(async function test_aria_roles() {
32+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_NEXT_ENABLED_PREF, true]] });
33+
await withFirefoxView({}, async browser => {
34+
const { document } = browser.contentWindow;
35+
is(document.location.href, "about:firefoxview-next");
1236

1337
is(
1438
document.querySelector("main").getAttribute("role"),
@@ -75,6 +99,12 @@ add_task(async function test_aria_roles() {
7599
"Focus should be on button element of the synced tabs empty state"
76100
);
77101
});
102+
// Verify pref disables new Firefox view
103+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_NEXT_ENABLED_PREF, false]] });
104+
await withFirefoxView({}, async browser => {
105+
const { document } = browser.contentWindow;
106+
is(document.location.href, "about:firefoxview");
107+
});
78108
});
79109

80110
add_task(async function firefoxview_next_icon() {

browser/components/firefoxview/tests/browser/firefoxview-next/browser_firefoxview_next_general_telemetry.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
/* import-globals-from ../head.js */
55

6+
const FXVIEW_NEXT_ENABLED_PREF = "browser.tabs.firefox-view-next";
67
const CARD_COLLAPSED_EVENT = [
78
["firefoxview_next", "card_collapsed", "card_container", undefined],
89
];
@@ -25,6 +26,7 @@ let enteredTelemetry = [
2526
];
2627

2728
add_setup(async () => {
29+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_NEXT_ENABLED_PREF, true]] });
2830
registerCleanupFunction(async () => {
2931
await SpecialPowers.popPrefEnv();
3032
clearHistory();
@@ -37,7 +39,7 @@ add_task(async function firefox_view_entered_telemetry() {
3739
const { document } = browser.contentWindow;
3840
is(
3941
document.location.href,
40-
"about:firefoxview",
42+
"about:firefoxview-next",
4143
"The Recent browsing page is showing."
4244
);
4345
let enteredAndTabSelectedEvents = [tabSelectedTelemetry, enteredTelemetry];
@@ -69,7 +71,7 @@ add_task(async function test_collapse_and_expand_card() {
6971
const { document } = browser.contentWindow;
7072
is(
7173
document.location.href,
72-
"about:firefoxview",
74+
"about:firefoxview-next",
7375
"The Recent browsing page is showing."
7476
);
7577

@@ -111,7 +113,7 @@ add_task(async function test_change_page_telemetry() {
111113
const { document } = browser.contentWindow;
112114
is(
113115
document.location.href,
114-
"about:firefoxview",
116+
"about:firefoxview-next",
115117
"The Recent browsing page is showing."
116118
);
117119
let changePageEvent = [
@@ -150,12 +152,13 @@ add_task(async function test_change_page_telemetry() {
150152
});
151153

152154
add_task(async function test_browser_context_menu_telemetry() {
155+
await SpecialPowers.pushPrefEnv({ set: [[FXVIEW_NEXT_ENABLED_PREF, true]] });
153156
const menu = document.getElementById("contentAreaContextMenu");
154157
await withFirefoxView({}, async browser => {
155158
const { document } = browser.contentWindow;
156159
is(
157160
document.location.href,
158-
"about:firefoxview",
161+
"about:firefoxview-next",
159162
"The Recent browsing page is showing."
160163
);
161164
await clearAllParentTelemetryEvents();
@@ -206,7 +209,7 @@ add_task(async function test_context_menu_new_window_telemetry() {
206209
const { document } = browser.contentWindow;
207210
is(
208211
document.location.href,
209-
"about:firefoxview",
212+
"about:firefoxview-next",
210213
"The Recent browsing page is showing."
211214
);
212215

@@ -262,7 +265,7 @@ add_task(async function test_context_menu_private_window_telemetry() {
262265
const { document } = browser.contentWindow;
263266
is(
264267
document.location.href,
265-
"about:firefoxview",
268+
"about:firefoxview-next",
266269
"The Recent browsing page is showing."
267270
);
268271

@@ -330,7 +333,7 @@ add_task(async function test_context_menu_delete_from_history_telemetry() {
330333
const { document } = browser.contentWindow;
331334
is(
332335
document.location.href,
333-
"about:firefoxview",
336+
"about:firefoxview-next",
334337
"The Recent browsing page is showing."
335338
);
336339

browser/components/firefoxview/tests/browser/firefoxview-next/browser_firefoxview_next_navigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/* import-globals-from ../head.js */
55

6-
const URL_BASE = "about:firefoxview#";
6+
const URL_BASE = "about:firefoxview-next#";
77

88
function assertCorrectPage(document, name, event) {
99
is(

browser/components/firefoxview/tests/browser/firefoxview-next/browser_history_firefoxview_next.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const SHOW_ALL_HISTORY_EVENT = [
1818
["firefoxview_next", "show_all_history", "tabs", undefined],
1919
];
2020

21+
const FXVIEW_NEXT_ENABLED_PREF = "browser.tabs.firefox-view-next";
2122
const NEVER_REMEMBER_HISTORY_PREF = "browser.privatebrowsing.autostart";
2223
const DAY_MS = 24 * 60 * 60 * 1000;
2324
const today = new Date();
@@ -152,7 +153,10 @@ async function addHistoryItems(dateAdded) {
152153

153154
add_setup(async () => {
154155
await SpecialPowers.pushPrefEnv({
155-
set: [["browser.firefox-view.search.enabled", true]],
156+
set: [
157+
[FXVIEW_NEXT_ENABLED_PREF, true],
158+
["browser.firefox-view.search.enabled", true],
159+
],
156160
});
157161
registerCleanupFunction(async () => {
158162
await SpecialPowers.popPrefEnv();
@@ -170,7 +174,7 @@ add_task(async function test_list_ordering() {
170174
await addHistoryItems(oneMonthAgo);
171175
await withFirefoxView({}, async browser => {
172176
const { document } = browser.contentWindow;
173-
is(document.location.href, "about:firefoxview");
177+
is(document.location.href, "about:firefoxview-next");
174178

175179
await navigateToCategoryAndWait(document, "history");
176180

@@ -264,7 +268,7 @@ add_task(async function test_empty_states() {
264268
await PlacesUtils.history.clear();
265269
await withFirefoxView({}, async browser => {
266270
const { document } = browser.contentWindow;
267-
is(document.location.href, "about:firefoxview");
271+
is(document.location.href, "about:firefoxview-next");
268272

269273
await navigateToCategoryAndWait(document, "history");
270274

@@ -402,7 +406,7 @@ add_task(async function test_show_all_history_telemetry() {
402406
await addHistoryItems(oneMonthAgo);
403407
await withFirefoxView({}, async browser => {
404408
const { document } = browser.contentWindow;
405-
is(document.location.href, "about:firefoxview");
409+
is(document.location.href, "about:firefoxview-next");
406410

407411
await navigateToCategoryAndWait(document, "history");
408412

0 commit comments

Comments
 (0)