mirror of
https://github.com/zen-browser/desktop.git
synced 2026-03-31 12:51:59 +00:00
test: Added tests for closing glance, b=(no-bug), c=glance, tests
This commit is contained in:
@@ -127,7 +127,7 @@
|
||||
if (gZenVerticalTabsManager._prefsRightSide) {
|
||||
this.sidebarButtons.setAttribute('right', true);
|
||||
} else {
|
||||
this.sidebarButtons.removeAttribute('right');
|
||||
this.sidebarButtons.setAttribute('right', false);
|
||||
}
|
||||
for (const button of this.sidebarButtons.querySelectorAll('toolbarbutton')) {
|
||||
button.style.opacity = 0;
|
||||
@@ -256,7 +256,12 @@
|
||||
hasFocused = false,
|
||||
skipPermitUnload = false,
|
||||
} = {}) {
|
||||
if (this._animating || !this.#currentBrowser || this.animatingOpen || this._duringOpening) {
|
||||
if (
|
||||
(this._animating && !onTabClose) ||
|
||||
!this.#currentBrowser ||
|
||||
(this.animatingOpen && !onTabClose) ||
|
||||
this._duringOpening
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,3 +5,4 @@ support-files = [
|
||||
|
||||
["browser_glance_basic.js"]
|
||||
["browser_glance_expand.js"]
|
||||
["browser_glance_close.js"]
|
||||
|
||||
25
src/zen/tests/glance/browser_glance_close.js
Normal file
25
src/zen/tests/glance/browser_glance_close.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
https://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
'use strict';
|
||||
|
||||
add_task(async function test_Glance_Basic_Close() {
|
||||
const currentTab = gBrowser.selectedTab;
|
||||
await openGlanceOnTab(async (glanceTab) => {
|
||||
ok(
|
||||
currentTab.hasAttribute('glance-id'),
|
||||
'The glance tab should have the zen-glance-tab attribute'
|
||||
);
|
||||
await BrowserTestUtils.removeTab(glanceTab);
|
||||
await new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve();
|
||||
}, 500);
|
||||
});
|
||||
ok(
|
||||
!currentTab.hasAttribute('glance-id'),
|
||||
'The glance tab should not have the zen-glance-tab attribute'
|
||||
);
|
||||
await BrowserTestUtils.removeTab(glanceTab);
|
||||
}, false);
|
||||
});
|
||||
Reference in New Issue
Block a user