browser_enabled_newtabpage.js 658 B

1234567891011121314151617181920
  1. function checkSpec(uri, check, message) {
  2. const {spec} = NetUtil.newChannel({
  3. loadUsingSystemPrincipal: true,
  4. uri,
  5. }).URI;
  6. info(`got ${spec} for ${uri}`);
  7. check(spec, "about:blank", message);
  8. }
  9. add_task(async function test_newtab_enabled() {
  10. checkSpec("about:newtab", isnot, "did not get blank for default about:newtab");
  11. checkSpec("about:home", isnot, "did not get blank for default about:home");
  12. await SpecialPowers.pushPrefEnv({set: [["browser.newtabpage.enabled", false]]});
  13. checkSpec("about:newtab", is, "got blank when newtab is not enabled");
  14. checkSpec("about:home", isnot, "still did not get blank for about:home");
  15. });