Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

/* Any copyright is dedicated to the Public Domain.
"use strict";
add_task(async function eventFiredWhenTabIsClosed({ client }) {
const { Target } = client;
const { newTab } = await openTab(Target);
const tabClosed = BrowserTestUtils.waitForEvent(newTab, "TabClose");
const targetDestroyed = Target.targetDestroyed();
info("Closing the tab");
BrowserTestUtils.removeTab(newTab);
await tabClosed;
info("Tab was closed");
await targetDestroyed;
info("Received the Target.targetDestroyed event");
});