mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-31 07:21:33 -07:00
fix(overlay): Linux X11/XWayland stacking, stale pause state, multi-copy selector (#101)
This commit is contained in:
@@ -26,8 +26,42 @@ test('reloadOverlayWindowsForYomitanContentScripts reloads only live overlay win
|
||||
reload: () => calls.push('destroyed-webcontents'),
|
||||
},
|
||||
},
|
||||
{
|
||||
isDestroyed: () => false,
|
||||
webContents: {
|
||||
isDestroyed: () => false,
|
||||
isLoading: () => true,
|
||||
reload: () => calls.push('loading-webcontents'),
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
assert.equal(reloadOverlayWindowsForYomitanContentScripts(windows), 1);
|
||||
assert.deepEqual(calls, ['live']);
|
||||
});
|
||||
|
||||
test('reloadOverlayWindowsForYomitanContentScripts retries loading webContents after load', () => {
|
||||
const calls: string[] = [];
|
||||
let finishLoad: (() => void) | null = null;
|
||||
const window = {
|
||||
isDestroyed: () => false,
|
||||
webContents: {
|
||||
isDestroyed: () => false,
|
||||
isLoading: () => true,
|
||||
once: (event: 'did-finish-load', listener: () => void) => {
|
||||
assert.equal(event, 'did-finish-load');
|
||||
finishLoad = listener;
|
||||
},
|
||||
reload: () => calls.push('reloaded-after-load'),
|
||||
},
|
||||
};
|
||||
|
||||
assert.equal(reloadOverlayWindowsForYomitanContentScripts([window]), 0);
|
||||
assert.deepEqual(calls, []);
|
||||
|
||||
assert.ok(finishLoad);
|
||||
const finish = finishLoad as () => void;
|
||||
finish();
|
||||
|
||||
assert.deepEqual(calls, ['reloaded-after-load']);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user