From e712e8204d0957012e35ef2ceff0b89ae00cfff0 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sat, 17 May 2025 14:12:43 +0200 Subject: [PATCH] test: Updated tests to the new names, b=(no-bug), c=tests, glance, workspaces, common --- .../browser_container_auto_switch.js | 12 ++++++------ .../browser_container_specific_essentials.js | 12 ++++++------ src/zen/tests/glance/browser_glance_close.js | 2 +- src/zen/tests/pinned/browser_pinned_created.js | 2 +- src/zen/tests/pinned/browser_pinned_to_essential.js | 2 +- src/zen/tests/workspaces/browser_basic_workspaces.js | 10 +++++----- .../tests/workspaces/browser_workspace_bookmarks.js | 10 +++++----- src/zen/toolkit/common/cocoa/ZenHapticFeedback.mm | 2 +- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/zen/tests/container_essentials/browser_container_auto_switch.js b/src/zen/tests/container_essentials/browser_container_auto_switch.js index e77b1c2da..b46279668 100644 --- a/src/zen/tests/container_essentials/browser_container_auto_switch.js +++ b/src/zen/tests/container_essentials/browser_container_auto_switch.js @@ -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); }); diff --git a/src/zen/tests/container_essentials/browser_container_specific_essentials.js b/src/zen/tests/container_essentials/browser_container_specific_essentials.js index 46ce01ed6..a376c0165 100644 --- a/src/zen/tests/container_essentials/browser_container_specific_essentials.js +++ b/src/zen/tests/container_essentials/browser_container_specific_essentials.js @@ -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); }); diff --git a/src/zen/tests/glance/browser_glance_close.js b/src/zen/tests/glance/browser_glance_close.js index 4dfe41d62..d9735d4be 100644 --- a/src/zen/tests/glance/browser_glance_close.js +++ b/src/zen/tests/glance/browser_glance_close.js @@ -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'), diff --git a/src/zen/tests/pinned/browser_pinned_created.js b/src/zen/tests/pinned/browser_pinned_created.js index c53234def..6a8070aa1 100644 --- a/src/zen/tests/pinned/browser_pinned_created.js +++ b/src/zen/tests/pinned/browser_pinned_created.js @@ -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) { diff --git a/src/zen/tests/pinned/browser_pinned_to_essential.js b/src/zen/tests/pinned/browser_pinned_to_essential.js index 302d0873b..51315384d 100644 --- a/src/zen/tests/pinned/browser_pinned_to_essential.js +++ b/src/zen/tests/pinned/browser_pinned_to_essential.js @@ -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.' ); diff --git a/src/zen/tests/workspaces/browser_basic_workspaces.js b/src/zen/tests/workspaces/browser_basic_workspaces.js index b4c254f31..2a6ac2017 100644 --- a/src/zen/tests/workspaces/browser_basic_workspaces.js +++ b/src/zen/tests/workspaces/browser_basic_workspaces.js @@ -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, diff --git a/src/zen/tests/workspaces/browser_workspace_bookmarks.js b/src/zen/tests/workspaces/browser_workspace_bookmarks.js index 3b20fbff7..8597aea68 100644 --- a/src/zen/tests/workspaces/browser_workspace_bookmarks.js +++ b/src/zen/tests/workspaces/browser_workspace_bookmarks.js @@ -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); }); }); diff --git a/src/zen/toolkit/common/cocoa/ZenHapticFeedback.mm b/src/zen/toolkit/common/cocoa/ZenHapticFeedback.mm index 602e9f396..eaea43ca7 100644 --- a/src/zen/toolkit/common/cocoa/ZenHapticFeedback.mm +++ b/src/zen/toolkit/common/cocoa/ZenHapticFeedback.mm @@ -23,7 +23,7 @@ nsresult ZenCommonUtils::PlayHapticFeedbackInternal() { if (@available(macOS 10.14, *)) { id 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