|
@@ -19,6 +19,7 @@ vi.mock('./config.service', () => ({
|
|
|
getDefaultAudioSensitivity: () => 1,
|
|
getDefaultAudioSensitivity: () => 1,
|
|
|
getDisablePuppetAnimation: () => false,
|
|
getDisablePuppetAnimation: () => false,
|
|
|
getScriptLimits: () => false,
|
|
getScriptLimits: () => false,
|
|
|
|
|
+ getFreshProcessOnPathChange: () => false,
|
|
|
getLoader: () => loaderSettings
|
|
getLoader: () => loaderSettings
|
|
|
}))
|
|
}))
|
|
|
|
|
|
|
@@ -27,6 +28,7 @@ const {
|
|
|
buildLweEnvVars,
|
|
buildLweEnvVars,
|
|
|
buildHotswapLines,
|
|
buildHotswapLines,
|
|
|
buildLweArgs,
|
|
buildLweArgs,
|
|
|
|
|
+ canHotswapExisting,
|
|
|
hotswapOptionsFor,
|
|
hotswapOptionsFor,
|
|
|
lwePackageOwner,
|
|
lwePackageOwner,
|
|
|
nodeDevelPackage,
|
|
nodeDevelPackage,
|
|
@@ -197,6 +199,34 @@ describe('buildHotswapLines', () => {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+describe('canHotswapExisting', () => {
|
|
|
|
|
+ const existing = { wallpaperPath: '/w/a', launchKey: 'k', controlFile: '/run/c' }
|
|
|
|
|
+
|
|
|
|
|
+ it('hotswaps a different wallpaper by default', () => {
|
|
|
|
|
+ expect(canHotswapExisting(existing, {}, 'k', '/w/b', 1, false)).toBe(true)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('starts a new process for a different path when that setting is on', () => {
|
|
|
|
|
+ expect(canHotswapExisting(existing, {}, 'k', '/w/b', 1, true)).toBe(false)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('keeps the same wallpaper on a hotswap even with the setting on', () => {
|
|
|
|
|
+ expect(canHotswapExisting(existing, {}, 'k', '/w/a', 1, true)).toBe(true)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('does not hotswap a forced fresh launch, a different key, or a missing engine', () => {
|
|
|
|
|
+ expect(canHotswapExisting(existing, { forceFresh: true }, 'k', '/w/a', 1, false)).toBe(false)
|
|
|
|
|
+ expect(canHotswapExisting(existing, {}, 'other', '/w/a', 1, false)).toBe(false)
|
|
|
|
|
+ expect(canHotswapExisting(undefined, {}, 'k', '/w/a', 0, false)).toBe(false)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('hotswaps a missing control file only when that engine is the only one', () => {
|
|
|
|
|
+ const bare = { wallpaperPath: '/w/a', launchKey: 'k', controlFile: null }
|
|
|
|
|
+ expect(canHotswapExisting(bare, {}, 'k', '/w/b', 1, false)).toBe(true)
|
|
|
|
|
+ expect(canHotswapExisting(bare, {}, 'k', '/w/b', 2, false)).toBe(false)
|
|
|
|
|
+ })
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
describe('buildCleanBuildEnv', () => {
|
|
describe('buildCleanBuildEnv', () => {
|
|
|
it('drops AppImage mount entries from path lists and the AppImage variables', () => {
|
|
it('drops AppImage mount entries from path lists and the AppImage variables', () => {
|
|
|
const saved = { ...process.env }
|
|
const saved = { ...process.env }
|