test_browser.js (683B)
1 const { Context } = ChromeUtils.importESModule( 2 "chrome://remote/content/marionette/browser.sys.mjs" 3 ); 4 5 add_task(function test_Context() { 6 ok(Context.hasOwnProperty("Chrome")); 7 ok(Context.hasOwnProperty("Content")); 8 equal(typeof Context.Chrome, "string"); 9 equal(typeof Context.Content, "string"); 10 equal(Context.Chrome, "chrome"); 11 equal(Context.Content, "content"); 12 }); 13 14 add_task(function test_Context_fromString() { 15 equal(Context.fromString("chrome"), Context.Chrome); 16 equal(Context.fromString("content"), Context.Content); 17 18 for (let typ of ["", "foo", true, 42, [], {}, null, undefined]) { 19 Assert.throws(() => Context.fromString(typ), /TypeError/); 20 } 21 });