From 79e731e89cf97d33294a42e6bd58205ba9068a8a Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Tue, 29 Apr 2025 18:27:00 +0200 Subject: [PATCH] test: Enable workspaces when doing tests, b=(no-bug), c=tests, workspaces --- src/zen/tests/browser.toml | 2 +- src/zen/tests/browser_zen_workspaces.js | 8 -------- .../tests/workspaces/browser_basic_workspaces.js | 13 +++++++++++++ src/zen/workspaces/ZenWorkspaces.mjs | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) delete mode 100644 src/zen/tests/browser_zen_workspaces.js create mode 100644 src/zen/tests/workspaces/browser_basic_workspaces.js diff --git a/src/zen/tests/browser.toml b/src/zen/tests/browser.toml index 4f13eca6f..3a2658416 100644 --- a/src/zen/tests/browser.toml +++ b/src/zen/tests/browser.toml @@ -1,2 +1,2 @@ -["browser_zen_workspaces.js"] +["workspaces/browser_basic_workspaces.js"] diff --git a/src/zen/tests/browser_zen_workspaces.js b/src/zen/tests/browser_zen_workspaces.js deleted file mode 100644 index 04fa358c3..000000000 --- a/src/zen/tests/browser_zen_workspaces.js +++ /dev/null @@ -1,8 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - https://creativecommons.org/publicdomain/zero/1.0/ */ - -'use strict'; - -add_task(async function test_TODO() { - ok(true, 'TODO: implement the test'); -}); diff --git a/src/zen/tests/workspaces/browser_basic_workspaces.js b/src/zen/tests/workspaces/browser_basic_workspaces.js new file mode 100644 index 000000000..73d38021e --- /dev/null +++ b/src/zen/tests/workspaces/browser_basic_workspaces.js @@ -0,0 +1,13 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +'use strict'; + +add_setup(async function () { + await ZenWorkspaces.createAndSaveWorkspace('Test Workspace 2'); +}); + +add_task(async function test_Check_Creation() { + const workspaces = await ZenWorkspaces._workspaces(); + ok(workspaces.workspaces.length, 2); +}); diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index 72bf7e2a4..fff326c49 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -678,7 +678,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { get workspaceEnabled() { if (typeof this._workspaceEnabled === 'undefined') { - this._workspaceEnabled = !gZenUIManager.testingEnabled && this.shouldHaveWorkspaces; + this._workspaceEnabled = this.shouldHaveWorkspaces; } return this._workspaceEnabled && !window.closed; }