mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 22:07:41 +00:00
Bug 1759822 - [devtools] Move waitForTitleChange to the one test using this. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D141190
This commit is contained in:
parent
3272cdee66
commit
570f8b932b
@ -19,6 +19,20 @@ const L10N = new LocalizationHelper(
|
||||
"devtools/client/locales/toolbox.properties"
|
||||
);
|
||||
|
||||
/**
|
||||
* Wait for a given toolbox to get its title updated.
|
||||
*/
|
||||
function waitForTitleChange(toolbox) {
|
||||
return new Promise(resolve => {
|
||||
toolbox.topWindow.addEventListener("message", function onmessage(event) {
|
||||
if (event.data.name == "set-host-title") {
|
||||
toolbox.topWindow.removeEventListener("message", onmessage);
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
add_task(async function() {
|
||||
Services.prefs.setBoolPref("devtools.command-button-frames.enabled", true);
|
||||
|
||||
|
@ -1370,20 +1370,6 @@ async function enableTargetSwitching() {
|
||||
await pushPref(TARGET_SWITCHING_PREF, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait for a given toolbox to get its title updated.
|
||||
*/
|
||||
function waitForTitleChange(toolbox) {
|
||||
return new Promise(resolve => {
|
||||
toolbox.topWindow.addEventListener("message", function onmessage(event) {
|
||||
if (event.data.name == "set-host-title") {
|
||||
toolbox.topWindow.removeEventListener("message", onmessage);
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an HTTP server that can be used to simulate custom requests within
|
||||
* a test. It is automatically cleaned up when the test ends, so no need to
|
||||
|
Loading…
x
Reference in New Issue
Block a user