diff options
Diffstat (limited to '')
-rw-r--r-- | toolkit/components/aboutprocesses/tests/browser/browser_aboutprocesses_utility_actors.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/toolkit/components/aboutprocesses/tests/browser/browser_aboutprocesses_utility_actors.js b/toolkit/components/aboutprocesses/tests/browser/browser_aboutprocesses_utility_actors.js new file mode 100644 index 0000000000..8ab7dcb747 --- /dev/null +++ b/toolkit/components/aboutprocesses/tests/browser/browser_aboutprocesses_utility_actors.js @@ -0,0 +1,44 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test about:processes preparation of utility actor names. +add_task(async function testUtilityActorNames() { + await BrowserTestUtils.withNewTab( + { + gBrowser, + opening: "about:processes", + waitForLoad: true, + }, + browser => { + const View = browser.contentWindow.View; + const unknownActorName = "unknown"; + const kDontExistFluentName = + View.utilityActorNameToFluentName("i-dont-exist"); + const unknownFluentName = + View.utilityActorNameToFluentName(unknownActorName); + + Assert.equal( + unknownFluentName, + kDontExistFluentName, + "Anything is unknown" + ); + + for (let actorName of ChromeUtils.getAllPossibleUtilityActorNames()) { + const fluentName = View.utilityActorNameToFluentName(actorName); + if (actorName === unknownActorName) { + Assert.ok( + fluentName === unknownFluentName, + `Actor name ${actorName} is expected unknown ${fluentName}` + ); + } else { + Assert.ok( + fluentName !== unknownFluentName, + `Actor name ${actorName} is known ${fluentName}` + ); + } + } + } + ); +}); |