B2G/gecko/browser/base/content/test/newtab/browser_newtab_disable.js
/*
 * These tests make sure that the 'New Tab Page' feature can be disabled if the
 * decides not to use it.
 */
These tests make sure that the 'New Tab Page' feature can be disabled if the
decides not to use it.
These tests make sure that the ' New Tab Page ' feature can be disabled if the decides not to use it .
function runTests() {
  yield setLinks("0,1,2,3,4,5,6,7,8");
  setPinnedLinks("");
  yield addNewTabPageTab();
  let gridNode = getGrid().node;
  ok(!gridNode.hasAttribute("page-disabled"), "page is not disabled");
  NewTabUtils.allPages.enabled = false;
  ok(gridNode.hasAttribute("page-disabled"), "page is disabled");
  let oldGridNode = gridNode;
  yield addNewTabPageTab();
  ok(gridNode.hasAttribute("page-disabled"), "page is disabled");
  is(0, getContentDocument().querySelectorAll(".site").length, "no sites have been rendered");
  NewTabUtils.allPages.enabled = true;
  ok(!gridNode.hasAttribute("page-disabled"), "page is not disabled");
  ok(!oldGridNode.hasAttribute("page-disabled"), "old page is not disabled");
}
function runTests ( ) { yield setLinks ( "0,1,2,3,4,5,6,7,8" ) ; setPinnedLinks ( "" ) ; yield addNewTabPageTab ( ) ; let gridNode = getGrid ( ) . node ; ok ( ! gridNode . hasAttribute ( "page-disabled" ) , "page is not disabled" ) ; NewTabUtils . allPages . enabled = false ; ok ( gridNode . hasAttribute ( "page-disabled" ) , "page is disabled" ) ; let oldGridNode = gridNode ; yield addNewTabPageTab ( ) ; ok ( gridNode . hasAttribute ( "page-disabled" ) , "page is disabled" ) ; is ( 0 , getContentDocument ( ) . querySelectorAll ( ".site" ) . length , "no sites have been rendered" ) ; NewTabUtils . allPages . enabled = true ; ok ( ! gridNode . hasAttribute ( "page-disabled" ) , "page is not disabled" ) ; ok ( ! oldGridNode . hasAttribute ( "page-disabled" ) , "old page is not disabled" ) ; }
These tests make sure that the 'New Tab Page' feature can be disabled if the
 decides not to use it.
These tests make sure that the ' New Tab Page ' feature can be disabled if the decides not to use it .
// create a new tab page and hide it. // create a second new tage page and make sure it's disabled. enable it // again and check if the former page gets enabled as well. // check that no sites have been rendered