mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
bug 1607500: remote: preserve task name in add_agent_task() r=remote-protocol-reviewers,whimboo
Similarly to bug 1603451, the name of the function passed to the specialised add_agent_task() is lost because of the anonymous function wrapper inside. Differential Revision: https://phabricator.services.mozilla.com/D58967 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
290bc505ff
commit
e221feba47
@ -10,16 +10,21 @@ const { Preferences } = ChromeUtils.import(
|
||||
const URL = Services.io.newURI("http://localhost:0");
|
||||
|
||||
// set up test conditions and clean up
|
||||
function add_agent_task(taskFn) {
|
||||
add_plain_task(async () => {
|
||||
function add_agent_task(originalTask) {
|
||||
const task = async function() {
|
||||
try {
|
||||
await RemoteAgent.close();
|
||||
await taskFn();
|
||||
await originalTask();
|
||||
} finally {
|
||||
Preferences.reset("remote.enabled");
|
||||
Preferences.reset("remote.force-local");
|
||||
}
|
||||
};
|
||||
Object.defineProperty(task, "name", {
|
||||
value: originalTask.name,
|
||||
writable: false,
|
||||
});
|
||||
add_plain_task(task);
|
||||
}
|
||||
|
||||
add_agent_task(async function listening() {
|
||||
|
Loading…
Reference in New Issue
Block a user