1
0
Fork 0
firefox/accessible/tests/browser/events/browser_tab_name_change.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

38 lines
1 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/* import-globals-from ../../mochitest/role.js */
loadScripts({ name: "role.js", dir: MOCHITESTS_DIR });
addAccessibleTask(``, async function (browser, _accDoc) {
let tabChanged = waitForEvent(
EVENT_FOCUS,
e => e.accessible.name == "One" && e.accessible.role == ROLE_DOCUMENT
);
// Put new tab in foreground
let tab = await BrowserTestUtils.openNewForegroundTab({
gBrowser,
url: "data:text/html,<title>One</title>",
});
await tabChanged;
let nameChanged = waitForEvent(
EVENT_NAME_CHANGE,
e => e.accessible.name == "Two" && e.accessible.role == ROLE_PAGETAB
);
// Change name of background tab
BrowserTestUtils.startLoadingURIString(
browser,
"data:text/html,<title>Two</title>"
);
await nameChanged;
BrowserTestUtils.removeTab(tab);
});