Skip to content

Commit be99f38

Browse files
committed
Backed out 2 changesets (bug 1869605, bug 1864534) for bc failures on browser_all_files_referenced.js.
Backed out changeset 576e61e3970b (bug 1864534) Backed out changeset 05b09125b90b (bug 1869605)
1 parent afcc0ef commit be99f38

32 files changed

+4635
-12
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: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9968,6 +9968,7 @@ var FirefoxViewHandler = {
99689968
this._updateEnabledState = this._updateEnabledState.bind(this);
99699969
this._updateEnabledState();
99709970
NimbusFeatures.majorRelease2022.onUpdate(this._updateEnabledState);
9971+
NimbusFeatures.firefoxViewNext.onUpdate(this._updateEnabledState);
99719972

99729973
ChromeUtils.defineESModuleGetters(this, {
99739974
SyncedTabs: "resource://services-sync/SyncedTabs.sys.mjs",
@@ -9978,9 +9979,12 @@ var FirefoxViewHandler = {
99789979
CustomizableUI.removeListener(this);
99799980
Services.obs.removeObserver(this, "firefoxview-notification-dot-update");
99809981
NimbusFeatures.majorRelease2022.offUpdate(this._updateEnabledState);
9982+
NimbusFeatures.firefoxViewNext.offUpdate(this._updateEnabledState);
99819983
},
99829984
_updateEnabledState() {
9983-
this._enabled = NimbusFeatures.majorRelease2022.getVariable("firefoxView");
9985+
this._enabled =
9986+
NimbusFeatures.majorRelease2022.getVariable("firefoxView") ||
9987+
NimbusFeatures.firefoxViewNext.getVariable("enabled");
99849988
// We use a root attribute because there's no guarantee the button is in the
99859989
// DOM, and visibility changes need to take effect even if it isn't in the DOM
99869990
// right now.
@@ -10015,7 +10019,9 @@ var FirefoxViewHandler = {
1001510019
CustomizableUI.getPlacementOfWidget("tabbrowser-tabs").position
1001610020
);
1001710021
}
10018-
const viewURL = "about:firefoxview";
10022+
const viewURL = NimbusFeatures.firefoxViewNext.getVariable("enabled")
10023+
? "about:firefoxview-next"
10024+
: "about:firefoxview";
1001910025
// Need to account for navigation to Firefox View pages
1002010026
if (
1002110027
this.tab &&
@@ -10113,11 +10119,18 @@ var FirefoxViewHandler = {
1011310119
const PREF_NAME = "browser.firefox-view.view-count";
1011410120
const MAX_VIEW_COUNT = 10;
1011510121
let viewCount = Services.prefs.getIntPref(PREF_NAME, 0);
10122+
let isFirefoxViewNext = Services.prefs.getBoolPref(
10123+
"browser.tabs.firefox-view-next",
10124+
false
10125+
);
1011610126

1011710127
// Record telemetry
10118-
Services.telemetry.setEventRecordingEnabled("firefoxview_next", true);
10128+
Services.telemetry.setEventRecordingEnabled(
10129+
isFirefoxViewNext ? "firefoxview_next" : "firefoxview",
10130+
true
10131+
);
1011910132
Services.telemetry.recordEvent(
10120-
"firefoxview_next",
10133+
isFirefoxViewNext ? "firefoxview_next" : "firefoxview",
1012110134
"tab_selected",
1012210135
"toolbarbutton",
1012310136
null,

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/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/browser.toml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[DEFAULT]
22
support-files = ["head.js"]
33
prefs = [
4+
"browser.tabs.firefox-view-next=false",
45
"browser.sessionstore.closedTabsFromAllWindows=true",
56
"browser.sessionstore.closedTabsFromClosedWindows=true",
67
"browser.tabs.firefox-view.logLevel=All",
@@ -23,13 +24,47 @@ skip-if = ["os == 'linux'"] # Bug 1784343
2324

2425
["browser_firefoxview.js"]
2526

27+
["browser_firefoxview_accessibility.js"]
28+
2629
["browser_firefoxview_tab.js"]
2730

31+
["browser_keyboard_focus.js"]
32+
2833
["browser_notification_dot.js"]
2934
skip-if = ["true"] # Bug 1851453
3035

36+
["browser_recently_closed_tabs.js"]
37+
fail-if = ["a11y_checks"] # Bug 1854625 clicked a.closed-tab-li-title may not be focusable
38+
39+
["browser_recently_closed_tabs_keyboard.js"]
40+
41+
["browser_recently_closed_tabs_windows.js"]
42+
fail-if = ["a11y_checks"] # Bug 1854625 clicked a.closed-tab-li-title may not be focusable
43+
3144
["browser_reload_firefoxview.js"]
3245

46+
["browser_setup_errors.js"]
47+
48+
["browser_setup_primary_password.js"]
49+
50+
["browser_setup_state.js"]
51+
52+
["browser_setup_synced_tabs_loading.js"]
53+
54+
["browser_sync_admin_disabled.js"]
55+
3356
["browser_tab_close_last_tab.js"]
3457

3558
["browser_tab_on_close_warning.js"]
59+
60+
["browser_tab_pickup_device_added_telemetry.js"]
61+
62+
["browser_tab_pickup_list.js"]
63+
skip-if = [
64+
"os == 'linux'", # Bug 1824273
65+
"os == 'win'", # Bug 1824273
66+
]
67+
68+
["browser_tab_pickup_visibility.js"]
69+
70+
["browser_ui_state.js"]

browser/components/firefoxview/tests/browser/browser_firefoxview.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,22 @@
22
* http://creativecommons.org/publicdomain/zero/1.0/ */
33

44
add_task(async function about_firefoxview_smoke_test() {
5+
await SpecialPowers.pushPrefEnv({
6+
set: [["browser.tabs.firefox-view-next", false]],
7+
});
8+
59
await withFirefoxView({}, async browser => {
610
const { document } = browser.contentWindow;
711

812
// sanity check the important regions exist on this page
913
ok(
10-
document.querySelector("fxview-category-navigation"),
11-
"fxview-category-navigation element exists"
14+
document.getElementById("tab-pickup-container"),
15+
"tab-pickup-container element exists"
16+
);
17+
ok(
18+
document.getElementById("recently-closed-tabs-container"),
19+
"recently-closed-tabs-container element exists"
1220
);
13-
ok(document.querySelector("named-deck"), "named-deck element exists");
1421
});
22+
await SpecialPowers.popPrefEnv();
1523
});
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/* Any copyright is dedicated to the Public Domain.
2+
http://creativecommons.org/publicdomain/zero/1.0/ */
3+
4+
"use strict";
5+
6+
/**
7+
* Tests that are related to the accessibility of the Firefox View
8+
* document. These tasks tend to be privileged content, not browser
9+
* chrome.
10+
*/
11+
12+
add_setup(async function setup() {
13+
// Make sure the prompt to connect FxA doesn't show
14+
// Without resetting the view-count pref it gets surfaced after
15+
// the third click on the fx view toolbar button.
16+
await SpecialPowers.pushPrefEnv({
17+
set: [
18+
["browser.firefox-view.view-count", 0],
19+
["browser.tabs.firefox-view-next", false],
20+
],
21+
});
22+
registerCleanupFunction(async () => {
23+
await SpecialPowers.popPrefEnv();
24+
});
25+
});
26+
27+
add_task(async function test_keyboard_focus_after_tab_pickup_opened() {
28+
// Reset various things touched by other tests in this file so that
29+
// we have a sufficiently clean environment.
30+
31+
TabsSetupFlowManager.resetInternalState();
32+
33+
// Ensure that the tab-pickup section doesn't need to be opened.
34+
Services.prefs.clearUserPref(
35+
"browser.tabs.firefox-view.ui-state.tab-pickup.open"
36+
);
37+
38+
// Let's be deterministic about the basic UI state!
39+
const sandbox = setupMocks({
40+
state: UIState.STATUS_NOT_CONFIGURED,
41+
syncEnabled: false,
42+
});
43+
44+
await withFirefoxView({}, async browser => {
45+
const { document } = browser.contentWindow;
46+
let win = browser.ownerGlobal;
47+
48+
is(
49+
document.activeElement.localName,
50+
"body",
51+
"document body element is initially focused"
52+
);
53+
54+
const tab = () => {
55+
info("Tab keypress synthesized");
56+
EventUtils.synthesizeKey("KEY_Tab", {}, win);
57+
};
58+
59+
tab();
60+
61+
let tabPickupContainer = document.querySelector(
62+
"#tab-pickup-container summary.page-section-header"
63+
);
64+
is(
65+
document.activeElement,
66+
tabPickupContainer,
67+
"tab pickup container header has focus"
68+
);
69+
70+
tab();
71+
72+
is(
73+
document.activeElement.id,
74+
"firefoxview-tabpickup-step-signin-primarybutton",
75+
"tab pickup primary button has focus"
76+
);
77+
});
78+
79+
// cleanup time
80+
await tearDown(sandbox);
81+
});
82+
83+
add_task(async function test_keyboard_accessibility_tab_pickup() {
84+
await withFirefoxView({}, async browser => {
85+
const win = browser.ownerGlobal;
86+
const { document } = browser.contentWindow;
87+
const enter = async () => {
88+
info("Enter");
89+
EventUtils.synthesizeKey("KEY_Enter", {}, win);
90+
};
91+
let details = document.getElementById("tab-pickup-container");
92+
let summary = details.querySelector("summary");
93+
ok(summary, "summary element should exist");
94+
ok(details.open, "Tab pickup container should be initially open on load");
95+
summary.focus();
96+
await enter();
97+
ok(!details.open, "Tab pickup container should be closed");
98+
await enter();
99+
ok(details.open, "Tab pickup container should be opened");
100+
});
101+
cleanup_tab_pickup();
102+
});
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/* Any copyright is dedicated to the Public Domain.
2+
* http://creativecommons.org/publicdomain/zero/1.0/ */
3+
4+
ChromeUtils.defineESModuleGetters(globalThis, {
5+
SyncedTabs: "resource://services-sync/SyncedTabs.sys.mjs",
6+
});
7+
8+
const SYNCED_URI = syncedTabsData1[0].tabs[1].url;
9+
10+
add_task(async function test_keyboard_focus() {
11+
await SpecialPowers.pushPrefEnv({
12+
set: [["accessibility.tabfocus", 7]],
13+
});
14+
15+
await withFirefoxView({}, async browser => {
16+
const { document } = browser.contentWindow;
17+
18+
const sandbox = setupRecentDeviceListMocks();
19+
const syncedTabsMock = sandbox.stub(SyncedTabs, "getRecentTabs");
20+
let mockTabs1 = getMockTabData(syncedTabsData1);
21+
syncedTabsMock.returns(mockTabs1);
22+
23+
await setupListState(browser);
24+
25+
testVisibility(browser, {
26+
expectedVisible: {
27+
"ol.synced-tabs-list": true,
28+
},
29+
});
30+
31+
let tabPickupEle = document.querySelector(".synced-tab-a");
32+
document.querySelector(".page-section-header").focus();
33+
34+
EventUtils.synthesizeKey("KEY_Tab");
35+
36+
is(
37+
tabPickupEle,
38+
document.activeElement,
39+
"The first tab pickup link is focused"
40+
);
41+
42+
let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, SYNCED_URI);
43+
EventUtils.synthesizeKey("KEY_Enter");
44+
await newTabPromise;
45+
46+
is(
47+
SYNCED_URI,
48+
gBrowser.selectedBrowser.currentURI.displaySpec,
49+
"We opened the tab via keyboard"
50+
);
51+
52+
let sessionStorePromise = BrowserTestUtils.waitForSessionStoreUpdate(
53+
gBrowser.selectedTab
54+
);
55+
gBrowser.removeTab(gBrowser.selectedTab);
56+
await sessionStorePromise;
57+
58+
window.FirefoxViewHandler.openTab();
59+
60+
let recentlyClosedEle = await TestUtils.waitForCondition(() =>
61+
document.querySelector(".closed-tab-li-main")
62+
);
63+
document.querySelectorAll(".page-section-header")[1].focus();
64+
65+
EventUtils.synthesizeKey("KEY_Tab");
66+
67+
is(
68+
recentlyClosedEle,
69+
document.activeElement,
70+
"The recently closed tab is focused"
71+
);
72+
73+
newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, SYNCED_URI);
74+
EventUtils.synthesizeKey("KEY_Enter");
75+
await newTabPromise;
76+
is(
77+
SYNCED_URI,
78+
gBrowser.selectedBrowser.currentURI.displaySpec,
79+
"We opened the tab via keyboard"
80+
);
81+
gBrowser.removeTab(gBrowser.selectedTab);
82+
83+
sessionStorePromise = TestUtils.topicObserved(
84+
"sessionstore-closed-objects-changed"
85+
);
86+
SessionStore.forgetClosedTab(window, 0);
87+
await sessionStorePromise;
88+
89+
sandbox.restore();
90+
});
91+
});

0 commit comments

Comments
 (0)