mirror of
https://github.com/zen-browser/desktop.git
synced 2025-11-24 03:00:26 +00:00
test: Fixed drag and drop tests hanging on some cases, b=no-bug, c=tests, tabs, workspaces
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..4ad544fe4dae7b7619b629aa33df6b1066502675 100644
|
index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..e6b46996d96706d3641b6fc5c435a0291b4d8d35 100644
|
||||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
@@ -422,15 +422,49 @@
|
@@ -422,15 +422,49 @@
|
||||||
@@ -667,7 +667,7 @@ index 96fd8acdc09cc4c9649d1ed7503c2a0bde536613..4ad544fe4dae7b7619b629aa33df6b10
|
|||||||
|
|
||||||
moveActionCallback();
|
moveActionCallback();
|
||||||
|
|
||||||
+ gZenWorkspaces._makeSureEmptyTabIsLast();
|
+ gZenWorkspaces.makeSureEmptyTabIsFirst();
|
||||||
+ gZenViewSplitter._maybeRemoveFakeBrowser(false);
|
+ gZenViewSplitter._maybeRemoveFakeBrowser(false);
|
||||||
+ gZenViewSplitter._canDrop = false;
|
+ gZenViewSplitter._canDrop = false;
|
||||||
+
|
+
|
||||||
|
|||||||
@@ -152,13 +152,13 @@ add_task(async function test_basic_unpinned_vertical_ltr() {
|
|||||||
await dropAfter(tab1, tab2, window);
|
await dropAfter(tab1, tab2, window);
|
||||||
Assert.deepEqual(
|
Assert.deepEqual(
|
||||||
gBrowser.tabs,
|
gBrowser.tabs,
|
||||||
[tab2, tab1, tab3, emptyTab],
|
[emptyTab, tab2, tab1, tab3],
|
||||||
'confirm that tab1 moved after tab2'
|
'confirm that tab1 moved after tab2'
|
||||||
);
|
);
|
||||||
await dropAfter(tab1, tab3, window);
|
await dropAfter(tab1, tab3, window);
|
||||||
Assert.deepEqual(
|
Assert.deepEqual(
|
||||||
gBrowser.tabs,
|
gBrowser.tabs,
|
||||||
[tab2, tab3, tab1, emptyTab],
|
[emptyTab, tab2, tab3, tab1],
|
||||||
'confirm that tab1 moved after tab3'
|
'confirm that tab1 moved after tab3'
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -166,13 +166,13 @@ add_task(async function test_basic_unpinned_vertical_ltr() {
|
|||||||
await dropBefore(tab1, tab3, window);
|
await dropBefore(tab1, tab3, window);
|
||||||
Assert.deepEqual(
|
Assert.deepEqual(
|
||||||
gBrowser.tabs,
|
gBrowser.tabs,
|
||||||
[tab2, tab1, tab3, emptyTab],
|
[emptyTab, tab2, tab1, tab3],
|
||||||
'confirm that tab1 moved before tab3'
|
'confirm that tab1 moved before tab3'
|
||||||
);
|
);
|
||||||
await dropBefore(tab1, tab2, window);
|
await dropBefore(tab1, tab2, window);
|
||||||
Assert.deepEqual(
|
Assert.deepEqual(
|
||||||
gBrowser.tabs,
|
gBrowser.tabs,
|
||||||
[tab1, tab2, tab3, emptyTab],
|
[emptyTab, tab1, tab2, tab3],
|
||||||
'confirm that tab1 moved before tab2'
|
'confirm that tab1 moved before tab2'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1540,8 +1540,6 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
gBrowser.pinnedTabsContainer = this.pinnedTabsContainer || gBrowser.pinnedTabsContainer;
|
gBrowser.pinnedTabsContainer = this.pinnedTabsContainer || gBrowser.pinnedTabsContainer;
|
||||||
gBrowser.tabContainer.pinnedTabsContainer =
|
gBrowser.tabContainer.pinnedTabsContainer =
|
||||||
this.pinnedTabsContainer || gBrowser.tabContainer.pinnedTabsContainer;
|
this.pinnedTabsContainer || gBrowser.tabContainer.pinnedTabsContainer;
|
||||||
// Move empty tab to the new workspace
|
|
||||||
this._moveEmptyTabToWorkspace(workspace.uuid);
|
|
||||||
|
|
||||||
this.tabContainer._invalidateCachedTabs();
|
this.tabContainer._invalidateCachedTabs();
|
||||||
if (!whileScrolling) {
|
if (!whileScrolling) {
|
||||||
@@ -1563,16 +1561,12 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_moveEmptyTabToWorkspace(workspaceUuid) {
|
makeSureEmptyTabIsFirst() {
|
||||||
this._makeSureEmptyTabIsLast();
|
|
||||||
}
|
|
||||||
|
|
||||||
_makeSureEmptyTabIsLast() {
|
|
||||||
const emptyTab = this._emptyTab;
|
const emptyTab = this._emptyTab;
|
||||||
if (emptyTab) {
|
if (emptyTab) {
|
||||||
const container = this.activeWorkspaceStrip;
|
const container = this.activeWorkspaceStrip;
|
||||||
if (container) {
|
if (container) {
|
||||||
container.insertBefore(emptyTab, container.lastChild);
|
container.insertBefore(emptyTab, container.firstChild);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._fixTabPositions();
|
this._fixTabPositions();
|
||||||
@@ -2316,6 +2310,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async updateTabsContainers(target = undefined, forAnimation = false) {
|
async updateTabsContainers(target = undefined, forAnimation = false) {
|
||||||
|
this.makeSureEmptyTabIsFirst();
|
||||||
if (target && !target.target?.parentNode) {
|
if (target && !target.target?.parentNode) {
|
||||||
target = null;
|
target = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user