Files
firefox/devtools/client/framework/test/browser_target_support.js
T
Alexandre Poirot d2d3164246 Bug 1810095 - [devtools] Remove now-unused Storage target scoped actor. r=devtools-reviewers,devtools-backward-compat-reviewers,jdescottes
This actor was only used by the legacy listener.
Its main method was listStores which exposed all the storage type actors.
Now they are exposed via storage Resource watchers.

This requires to tweak the decision making to show the storage panel
as the actor no longer exists... Unfortunately we can't check for
resource traits on the watcher actor as the browser toolbox
on older runtime won't expose it.

Note that this.front wasn't used for a little while in ui.js.

I had to keep a few things in the frontend in order to still be able
to connect to old servers. But I put lots of comments to do proper cleanup later.

Differential Revision: https://phabricator.services.mozilla.com/D166770
2023-01-29 20:50:48 +00:00

41 lines
888 B
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Test support methods on Target, such as `hasActor` and `getTrait`.
async function testTarget(client, target) {
is(
target.hasActor("inspector"),
true,
"target.hasActor() true when actor exists."
);
is(
target.hasActor("notreal"),
false,
"target.hasActor() false when actor does not exist."
);
is(
target.getTrait("giddyup"),
undefined,
"target.getTrait() returns undefined when trait does not exist"
);
close(target, client);
}
// Ensure target is closed if client is closed directly
function test() {
waitForExplicitFinish();
getParentProcessActors(testTarget);
}
function close(target, client) {
target.on("target-destroyed", () => {
ok(true, "Target was destroyed");
finish();
});
client.close();
}