1
0
Fork 0
firefox/remote/marionette/test/xpcshell/test_browser.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

21 lines
683 B
JavaScript

const { Context } = ChromeUtils.importESModule(
"chrome://remote/content/marionette/browser.sys.mjs"
);
add_task(function test_Context() {
ok(Context.hasOwnProperty("Chrome"));
ok(Context.hasOwnProperty("Content"));
equal(typeof Context.Chrome, "string");
equal(typeof Context.Content, "string");
equal(Context.Chrome, "chrome");
equal(Context.Content, "content");
});
add_task(function test_Context_fromString() {
equal(Context.fromString("chrome"), Context.Chrome);
equal(Context.fromString("content"), Context.Content);
for (let typ of ["", "foo", true, 42, [], {}, null, undefined]) {
Assert.throws(() => Context.fromString(typ), /TypeError/);
}
});