mirror of
https://github.com/zen-browser/desktop.git
synced 2025-12-28 09:04:42 +00:00
test: Updated tests to the new names, b=(no-bug), c=tests, glance, workspaces, common
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
'use strict';
|
||||
|
||||
add_task(async function test_Container_Essentials_Auto_Swithc() {
|
||||
await ZenWorkspaces.createAndSaveWorkspace('Container Profile 1', undefined, false, 1);
|
||||
const workspaces = await ZenWorkspaces._workspaces();
|
||||
await gZenWorkspaces.createAndSaveWorkspace('Container Profile 1', undefined, false, 1);
|
||||
const workspaces = await gZenWorkspaces._workspaces();
|
||||
ok(workspaces.workspaces.length === 2, 'Two workspaces should exist.');
|
||||
|
||||
let newTab = BrowserTestUtils.addTab(gBrowser, 'about:blank', {
|
||||
@@ -24,14 +24,14 @@ add_task(async function test_Container_Essentials_Auto_Swithc() {
|
||||
),
|
||||
'New tab should be marked as essential.'
|
||||
);
|
||||
const newWorkspaceUUID = ZenWorkspaces.activeWorkspace;
|
||||
const newWorkspaceUUID = gZenWorkspaces.activeWorkspace;
|
||||
Assert.equal(
|
||||
ZenWorkspaces.activeWorkspace,
|
||||
gZenWorkspaces.activeWorkspace,
|
||||
workspaces.workspaces[1].uuid,
|
||||
'The new workspace should be active.'
|
||||
);
|
||||
|
||||
// Change to the original workspace, there should be no essential tabs
|
||||
await ZenWorkspaces.changeWorkspace(workspaces.workspaces[0]);
|
||||
await ZenWorkspaces.removeWorkspace(newWorkspaceUUID);
|
||||
await gZenWorkspaces.changeWorkspace(workspaces.workspaces[0]);
|
||||
await gZenWorkspaces.removeWorkspace(newWorkspaceUUID);
|
||||
});
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
'use strict';
|
||||
|
||||
add_task(async function test_Check_Creation() {
|
||||
await ZenWorkspaces.createAndSaveWorkspace('Container Profile 1', undefined, false, 1);
|
||||
const workspaces = await ZenWorkspaces._workspaces();
|
||||
await gZenWorkspaces.createAndSaveWorkspace('Container Profile 1', undefined, false, 1);
|
||||
const workspaces = await gZenWorkspaces._workspaces();
|
||||
ok(workspaces.workspaces.length === 2, 'Two workspaces should exist.');
|
||||
|
||||
await ZenWorkspaces.changeWorkspace(workspaces.workspaces[1]);
|
||||
await gZenWorkspaces.changeWorkspace(workspaces.workspaces[1]);
|
||||
let newTab = BrowserTestUtils.addTab(gBrowser, 'about:blank', {
|
||||
skipAnimation: true,
|
||||
userContextId: 1,
|
||||
@@ -25,10 +25,10 @@ add_task(async function test_Check_Creation() {
|
||||
),
|
||||
'New tab should be marked as essential.'
|
||||
);
|
||||
const newWorkspaceUUID = ZenWorkspaces.activeWorkspace;
|
||||
const newWorkspaceUUID = gZenWorkspaces.activeWorkspace;
|
||||
|
||||
// Change to the original workspace, there should be no essential tabs
|
||||
await ZenWorkspaces.changeWorkspace(workspaces.workspaces[0]);
|
||||
await gZenWorkspaces.changeWorkspace(workspaces.workspaces[0]);
|
||||
ok(
|
||||
!gBrowser.tabs.find(
|
||||
(t) => t.hasAttribute('zen-essential') && t.getAttribute('usercontextid') == 1
|
||||
@@ -36,5 +36,5 @@ add_task(async function test_Check_Creation() {
|
||||
'No essential tabs should be found in the original workspace.'
|
||||
);
|
||||
|
||||
await ZenWorkspaces.removeWorkspace(newWorkspaceUUID);
|
||||
await gZenWorkspaces.removeWorkspace(newWorkspaceUUID);
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ add_task(async function test_Glance_Basic_Close() {
|
||||
await new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve();
|
||||
}, 500);
|
||||
}, 1000);
|
||||
});
|
||||
ok(
|
||||
!currentTab.hasAttribute('glance-id'),
|
||||
|
||||
@@ -31,7 +31,7 @@ add_task(async function test_Create_Pinned() {
|
||||
);
|
||||
Assert.equal(
|
||||
pinObject.workspaceUuid,
|
||||
ZenWorkspaces.activeWorkspace,
|
||||
gZenWorkspaces.activeWorkspace,
|
||||
'The pin object should have the correct workspace UUID'
|
||||
);
|
||||
} catch (error) {
|
||||
|
||||
@@ -22,7 +22,7 @@ add_task(async function test_Pinned_To_Essential() {
|
||||
|
||||
gZenPinnedTabManager.addToEssentials(newTab);
|
||||
ok(
|
||||
newTab.hasAttribute('zen-essential') && newTab.parentNode.getAttribute('container') == '1',
|
||||
newTab.hasAttribute('zen-essential') && newTab.parentNode.getAttribute('container') == '0',
|
||||
'New tab should be marked as essential.'
|
||||
);
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
add_setup(async function () {});
|
||||
|
||||
add_task(async function test_Check_Creation() {
|
||||
const currentWorkspaceUUID = ZenWorkspaces.activeWorkspace;
|
||||
await ZenWorkspaces.createAndSaveWorkspace('Test Workspace 2');
|
||||
const workspaces = await ZenWorkspaces._workspaces();
|
||||
const currentWorkspaceUUID = gZenWorkspaces.activeWorkspace;
|
||||
await gZenWorkspaces.createAndSaveWorkspace('Test Workspace 2');
|
||||
const workspaces = await gZenWorkspaces._workspaces();
|
||||
ok(workspaces.workspaces.length === 2, 'Two workspaces should exist.');
|
||||
ok(
|
||||
currentWorkspaceUUID !== workspaces.workspaces[1].uuid,
|
||||
@@ -22,8 +22,8 @@ add_task(async function test_Check_Creation() {
|
||||
ok(gBrowser.tabs.length === 2, 'There should be two tabs.');
|
||||
BrowserTestUtils.removeTab(newTab);
|
||||
|
||||
await ZenWorkspaces.removeWorkspace(ZenWorkspaces.activeWorkspace);
|
||||
const workspacesAfterRemove = await ZenWorkspaces._workspaces();
|
||||
await gZenWorkspaces.removeWorkspace(gZenWorkspaces.activeWorkspace);
|
||||
const workspacesAfterRemove = await gZenWorkspaces._workspaces();
|
||||
ok(workspacesAfterRemove.workspaces.length === 1, 'One workspace should exist.');
|
||||
ok(
|
||||
workspacesAfterRemove.workspaces[0].uuid === currentWorkspaceUUID,
|
||||
|
||||
@@ -102,8 +102,8 @@ add_task(async function test_workspace_bookmark() {
|
||||
return;
|
||||
|
||||
await withBookmarksShowing(async () => {
|
||||
await ZenWorkspaces.createAndSaveWorkspace('Test Workspace 2');
|
||||
const workspaces = await ZenWorkspaces._workspaces();
|
||||
await gZenWorkspaces.createAndSaveWorkspace('Test Workspace 2');
|
||||
const workspaces = await gZenWorkspaces._workspaces();
|
||||
ok(workspaces.workspaces.length === 2, 'Two workspaces should exist.');
|
||||
const firstWorkspace = workspaces.workspaces[0];
|
||||
const secondWorkspace = workspaces.workspaces[1];
|
||||
@@ -130,13 +130,13 @@ add_task(async function test_workspace_bookmark() {
|
||||
|
||||
await changeWorkspaceForBookmark(bookmark2, secondWorkspace);
|
||||
|
||||
await ZenWorkspaces.changeWorkspace(secondWorkspace);
|
||||
await gZenWorkspaces.changeWorkspace(secondWorkspace);
|
||||
const toolbarNode1 = getToolbarNodeForItemGuid(bookmark1.guid);
|
||||
const toolbarNode2 = getToolbarNodeForItemGuid(bookmark2.guid);
|
||||
ok(toolbarNode1, 'Bookmark1 should be in the toolbar');
|
||||
ok(!toolbarNode2, 'Bookmark2 should be in the toolbar');
|
||||
|
||||
await ZenWorkspaces.changeWorkspace(firstWorkspace);
|
||||
await gZenWorkspaces.changeWorkspace(firstWorkspace);
|
||||
|
||||
const toolbarNode3 = getToolbarNodeForItemGuid(bookmark1.guid);
|
||||
const toolbarNode4 = getToolbarNodeForItemGuid(bookmark2.guid);
|
||||
@@ -146,6 +146,6 @@ add_task(async function test_workspace_bookmark() {
|
||||
await PlacesUtils.bookmarks.remove(bookmark1);
|
||||
await PlacesUtils.bookmarks.remove(bookmark2);
|
||||
|
||||
await ZenWorkspaces.removeWorkspace(secondWorkspace.uuid);
|
||||
await gZenWorkspaces.removeWorkspace(secondWorkspace.uuid);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,7 +23,7 @@ nsresult ZenCommonUtils::PlayHapticFeedbackInternal() {
|
||||
if (@available(macOS 10.14, *)) {
|
||||
id<NSHapticFeedbackPerformer> performer = [NSHapticFeedbackManager defaultPerformer];
|
||||
[performer performFeedbackPattern:NSHapticFeedbackPatternAlignment
|
||||
performanceTime:NSHapticFeedbackPerformanceTimeDefault];
|
||||
performanceTime:NSHapticFeedbackPerformanceTimeDefault];
|
||||
} else {
|
||||
// Fallback on earlier versions
|
||||
// Note: This is a no-op on older versions of iOS/macOS
|
||||
|
||||
Reference in New Issue
Block a user