fix(extension): persist dynamic target selection

This commit is contained in:
Timo
2026-08-17 22:10:11 +02:00
parent 8eaf026487
commit 3c99efe4e4
6 changed files with 153 additions and 10 deletions
+17
View File
@@ -93,6 +93,23 @@ test('injects into the target tab and attaches to a same-origin frame player', a
).toBe('true');
});
test('keeps the selected tab after the popup page closes and reopens', async ({ context, extensionId, baseURL }) => {
const url = `${baseURL}/pages/simple-player.html`;
const page = await context.newPage();
await page.goto(url);
await page.waitForFunction(() => window.__fixtureReady === true);
const { tabId, response } = await selectTargetTab(context, extensionId, url);
expect(response).toMatchObject({ status: 'ok' });
const status = await getExtensionState(context, extensionId, { type: 'GET_STATUS' });
expect(status).toMatchObject({
targetTabId: tabId,
selectedTargetTabId: tabId,
requestedTargetTabId: null
});
});
test('applies remote play, pause and seek to the framed player', async ({ context, extensionId, baseURL }) => {
const url = `${baseURL}/pages/iframe-player.html`;
const page = await context.newPage();