mirror of
https://github.com/zen-browser/desktop.git
synced 2026-01-25 14:16:10 +00:00
test: Fixed tests for welcome page and fixed QA issues, b=bug #10666, c=common, tabs, tests, welcome, workspaces
This commit is contained in:
@@ -35,6 +35,9 @@
|
||||
- name: zen.theme.styled-status-panel
|
||||
value: '@IS_TWILIGHT@'
|
||||
|
||||
- name: zen.theme.hide-unified-extensions-button
|
||||
value: false
|
||||
|
||||
# ==== Mark: border radius ====
|
||||
|
||||
# macOS border radius
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs
|
||||
index d9a059f608779fea7cd8c595a432f6fe95183e0c..7f6493ced4abb1f6ba54242b8ee213a74f01aea5 100644
|
||||
index d9a059f608779fea7cd8c595a432f6fe95183e0c..97fbe5f7ac2c5bf18526528a8f50dcf4466fcafd 100644
|
||||
--- a/browser/components/customizableui/CustomizableUI.sys.mjs
|
||||
+++ b/browser/components/customizableui/CustomizableUI.sys.mjs
|
||||
@@ -14,6 +14,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
||||
@@ -177,17 +177,20 @@ index d9a059f608779fea7cd8c595a432f6fe95183e0c..7f6493ced4abb1f6ba54242b8ee213a7
|
||||
return { isOverflowing, targetContentWidth, totalAvailWidth };
|
||||
}
|
||||
|
||||
@@ -7970,7 +7971,8 @@ class OverflowableToolbar {
|
||||
@@ -7970,7 +7971,11 @@ class OverflowableToolbar {
|
||||
return;
|
||||
}
|
||||
}
|
||||
- if (totalAvailWidth <= minSize) {
|
||||
+ let isLastItem = win.gZenVerticalTabsManager._hasSetSingleToolbar && this.#target.id == 'zen-sidebar-top-buttons-customization-target' && this.#overflowedInfo.size == 1;
|
||||
+ let isLastItem = win.gZenVerticalTabsManager._hasSetSingleToolbar &&
|
||||
+ this.#target.id == 'zen-sidebar-top-buttons-customization-target' &&
|
||||
+ this.#overflowedInfo.size == 1 &&
|
||||
+ !child.classList.contains('unified-extensions-item');
|
||||
+ if (totalAvailWidth <= minSize && !isLastItem) {
|
||||
lazy.log.debug(
|
||||
`Need ${minSize} but width is ${totalAvailWidth} so bailing`
|
||||
);
|
||||
@@ -8003,7 +8005,7 @@ class OverflowableToolbar {
|
||||
@@ -8003,7 +8008,7 @@ class OverflowableToolbar {
|
||||
}
|
||||
}
|
||||
if (!inserted) {
|
||||
@@ -196,7 +199,7 @@ index d9a059f608779fea7cd8c595a432f6fe95183e0c..7f6493ced4abb1f6ba54242b8ee213a7
|
||||
}
|
||||
child.removeAttribute("cui-anchorid");
|
||||
child.removeAttribute("overflowedItem");
|
||||
@@ -8348,7 +8350,7 @@ class OverflowableToolbar {
|
||||
@@ -8348,7 +8353,7 @@ class OverflowableToolbar {
|
||||
break;
|
||||
}
|
||||
case "mousedown": {
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
menupopup,
|
||||
panel {
|
||||
--panel-background: var(--arrowpanel-background);
|
||||
--menuitem-padding: 6px !important;
|
||||
--panel-shadow-margin: 10px;
|
||||
|
||||
/* This should match GetMenuCornerRadius() on macOS, or be overridden below */
|
||||
|
||||
@@ -466,6 +466,12 @@ body > #confetti {
|
||||
}
|
||||
}
|
||||
|
||||
@media (-moz-pref('zen.theme.hide-unified-extensions-button')) {
|
||||
#unified-extensions-button {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
#unified-extensions-button:not([showing]) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@@ -1149,11 +1149,28 @@
|
||||
position: relative;
|
||||
--zen-essential-bg-margin: 2px;
|
||||
|
||||
&::before {
|
||||
background: light-dark(
|
||||
--zen-essential-tab-selected-bg: light-dark(
|
||||
rgba(255, 255, 255, 0.85),
|
||||
color-mix(in srgb, var(--zen-primary-color), rgba(68, 64, 64, 0.85) 40%)
|
||||
);
|
||||
--zen-essential-tab-selected-bg-hover: light-dark(
|
||||
rgba(255, 255, 255, 0.8),
|
||||
color-mix(in srgb, var(--zen-primary-color), rgba(68, 64, 64, 0.85) 50%)
|
||||
);
|
||||
|
||||
:root[zen-default-theme='true'] & {
|
||||
--zen-essential-tab-selected-bg: light-dark(
|
||||
rgba(255, 255, 255, 0.85),
|
||||
color-mix(in srgb, var(--zen-primary-color), rgba(68, 64, 64, 0.85) 40%)
|
||||
rgba(68, 64, 64, 0.85)
|
||||
);
|
||||
--zen-essential-tab-selected-bg-hover: light-dark(
|
||||
rgba(255, 255, 255, 0.8),
|
||||
rgba(68, 64, 64, 0.75)
|
||||
);
|
||||
}
|
||||
|
||||
&::before {
|
||||
background: var(--zen-essential-tab-selected-bg);
|
||||
margin: var(--zen-essential-bg-margin);
|
||||
border-radius: calc(var(--border-radius-medium) - var(--zen-essential-bg-margin));
|
||||
position: absolute;
|
||||
@@ -1165,10 +1182,7 @@
|
||||
}
|
||||
|
||||
&[visuallyselected]:hover .tab-background::before {
|
||||
background: light-dark(
|
||||
rgba(255, 255, 255, 0.8),
|
||||
color-mix(in srgb, var(--zen-primary-color), rgba(68, 64, 64, 0.85) 50%)
|
||||
);
|
||||
background: var(--zen-essential-tab-selected-bg-hover);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ add_task(async function test_Aria_Focusable_Tabs() {
|
||||
}
|
||||
Assert.equal(
|
||||
gBrowser.tabContainer.ariaFocusableItems.length,
|
||||
2,
|
||||
'There should be 2 focusable tabs (1 empty tab + 1 about:blank tab) at startup'
|
||||
1,
|
||||
'There should be 1 focusable tab (1 about:blank tab) at startup'
|
||||
);
|
||||
});
|
||||
|
||||
@@ -43,7 +43,6 @@ add_task(async function test_Welcome_Steps() {
|
||||
);
|
||||
|
||||
for (const child of welcomeContent.children) {
|
||||
console.log(child);
|
||||
ok(
|
||||
child.querySelector('img').getAttribute('src').includes('blob:'),
|
||||
'Welcome page content should have an image with a base64 data URL'
|
||||
@@ -66,7 +65,7 @@ add_task(async function test_Welcome_Steps() {
|
||||
}, 100); // Wait for the transition to complete
|
||||
});
|
||||
|
||||
await goNextWelcomePage('zen-welcome-next-action');
|
||||
await goNextWelcomePage('zen-generic-next');
|
||||
ok(true, 'Welcome Search Step Test Finished');
|
||||
|
||||
await new Promise((resolve) => {
|
||||
@@ -103,7 +102,7 @@ add_task(async function test_Welcome_Steps() {
|
||||
ok(url.startsWith('https://'), `The URL "${url}" should start with "https://"`);
|
||||
}
|
||||
|
||||
await goNextWelcomePage('zen-welcome-next-action');
|
||||
await goNextWelcomePage('zen-generic-next');
|
||||
|
||||
await new Promise((resolve) => {
|
||||
setTimeout(async () => {
|
||||
@@ -120,7 +119,7 @@ add_task(async function test_Welcome_Steps() {
|
||||
}, 1000); // Wait for the transition to complete
|
||||
});
|
||||
|
||||
await goNextWelcomePage('zen-welcome-next-action');
|
||||
await goNextWelcomePage('zen-generic-next');
|
||||
ok(true, 'Welcome Theme Step Test Finished');
|
||||
|
||||
await goNextWelcomePage('zen-welcome-start-browsing');
|
||||
|
||||
@@ -1470,9 +1470,15 @@
|
||||
gradient
|
||||
);
|
||||
const isDarkModeWindow = browser.gZenThemePicker.isDarkMode;
|
||||
const docElement = browser.document.documentElement;
|
||||
if (isDefaultTheme) {
|
||||
docElement.setAttribute('zen-default-theme', 'true');
|
||||
} else {
|
||||
docElement.removeAttribute('zen-default-theme');
|
||||
}
|
||||
if (dominantColor) {
|
||||
const primaryColor = this.getAccentColorForUI(dominantColor);
|
||||
browser.document.documentElement.style.setProperty('--zen-primary-color', primaryColor);
|
||||
docElement.style.setProperty('--zen-primary-color', primaryColor);
|
||||
|
||||
// Should be set to `this.isLegacyVersion` but for some reason it is set to undefined if we open a private window,
|
||||
// so instead get the pref value directly.
|
||||
@@ -1483,10 +1489,10 @@
|
||||
if (!isDefaultTheme && !this.isLegacyVersion) {
|
||||
// Check for the primary color
|
||||
isDarkMode = browser.gZenThemePicker.shouldBeDarkMode(dominantColor);
|
||||
browser.document.documentElement.setAttribute('zen-should-be-dark-mode', isDarkMode);
|
||||
docElement.setAttribute('zen-should-be-dark-mode', isDarkMode);
|
||||
browser.gZenThemePicker.panel.removeAttribute('invalidate-controls');
|
||||
} else {
|
||||
browser.document.documentElement.removeAttribute('zen-should-be-dark-mode');
|
||||
docElement.removeAttribute('zen-should-be-dark-mode');
|
||||
if (!this.isLegacyVersion) {
|
||||
browser.gZenThemePicker.panel.setAttribute('invalidate-controls', 'true');
|
||||
}
|
||||
|
||||
@@ -2181,6 +2181,13 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
return true; // Always show glance tabs
|
||||
}
|
||||
|
||||
// See https://github.com/zen-browser/desktop/issues/10666, we should never
|
||||
// show closing tabs and consider them as not part of any workspace. This will
|
||||
// invalidate the `lastSelectedTab[previousWorkspaceId]` logic in `_handleTabSelection`
|
||||
if (tab.closing) {
|
||||
return false; // Never show closing tabs
|
||||
}
|
||||
|
||||
// Handle essential tabs
|
||||
if (isEssential) {
|
||||
if (!this.containerSpecificEssentials) {
|
||||
|
||||
Reference in New Issue
Block a user