fune/testing/marionette/test/unit/test_browser.js
Victor Porof 2b036e45c5 Bug 1561435 - Format testing/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35962

--HG--
extra : source : c0948f31e520ca087279cf429ca5f1db5a8341b8
2019-07-05 11:01:24 +02:00

25 lines
703 B
JavaScript

const { Context } = ChromeUtils.import(
"chrome://marionette/content/browser.js"
);
add_test(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");
run_next_test();
});
add_test(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/);
}
run_next_test();
});