|
| 1 | +/* Any copyright is dedicated to the Public Domain. |
| 2 | + https://creativecommons.org/publicdomain/zero/1.0/ */ |
| 3 | + |
| 4 | +'use strict'; |
| 5 | + |
| 6 | +add_task(async function test_Split_View_Inside_Folder() { |
| 7 | + const [tab1, tab2] = await Promise.all([ |
| 8 | + addTabTo(gBrowser, getUrlForNthTab(1)), |
| 9 | + addTabTo(gBrowser, getUrlForNthTab(2)), |
| 10 | + ]); |
| 11 | + const pinEvent1 = BrowserTestUtils.waitForEvent(tab1, 'TabPinned'); |
| 12 | + const pinEvent2 = BrowserTestUtils.waitForEvent(tab2, 'TabPinned'); |
| 13 | + gBrowser.pinTab(tab1); |
| 14 | + gBrowser.pinTab(tab2); |
| 15 | + await Promise.all([pinEvent1, pinEvent2]); |
| 16 | + Assert.ok( |
| 17 | + gBrowser.tabs.length === 4, // empty + initial + 2 split tabs |
| 18 | + 'There should be four tabs after pinning both tabs' |
| 19 | + ); |
| 20 | + const folder = await gZenFolders.createFolder([tab1, tab2], { |
| 21 | + renameFolder: false, |
| 22 | + label: 'test', |
| 23 | + }); |
| 24 | + Assert.equal(tab1.group, folder, 'The first pinned tab should be in the folder group'); |
| 25 | + Assert.equal(tab2.group, folder, 'The second pinned tab should be in the folder group'); |
| 26 | + await createSplitView([tab1, tab2], 'grid'); |
| 27 | + ok( |
| 28 | + tab2.group === tab1.group, |
| 29 | + 'The second pinned tab should be in the same split group after duplication' |
| 30 | + ); |
| 31 | + ok( |
| 32 | + tab1.group.hasAttribute('split-view-group'), |
| 33 | + 'The first pinned tab should be in a split group after duplication' |
| 34 | + ); |
| 35 | + Assert.ok(tab1.group.pinned, 'The split group should be pinned after duplication of both tabs'); |
| 36 | + Assert.equal(tab1.group.group, folder, 'The split group should be the folder after duplication'); |
| 37 | + const removeEvent = BrowserTestUtils.waitForEvent(window, 'TabGroupRemoved'); |
| 38 | + folder.delete(); |
| 39 | + await removeEvent; |
| 40 | +}); |
0 commit comments