rollback draft
authorjordan9769 <souravgarg833@gmail.com>
Thu, 13 Oct 2016 05:50:10 +0530
changeset 425596 b1f61a46f790059726287b6b13e58b24d986870c
parent 425595 f7747da1535bd9c08b44be356213796cf1a1fac7
child 425597 3a26ce0312eda50c41223c224303cede7abe6873
push id32461
push userbmo:souravgarg833@gmail.com
push dateSat, 15 Oct 2016 01:55:59 +0000
milestone52.0a1
rollback MozReview-Commit-ID: 3v67DUuPcqw
browser/base/content/test/general/browser_aboutHome.js
--- a/browser/base/content/test/general/browser_aboutHome.js
+++ b/browser/base/content/test/general/browser_aboutHome.js
@@ -65,17 +65,17 @@ add_task(function* () {
 
       content.gSnippetsMap.delete("snippets");
     });
 });
 
 add_task(function* () {
   info("Check that performing a search fires a search event and records to Telemetry.");
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:newtab" }, function* (browser) {
+  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:home" }, function* (browser) {
     let currEngine = Services.search.currentEngine;
     let engine = yield promiseNewEngine("searchSuggestionEngine.xml");
     // Make this actually work in healthreport by giving it an ID:
     Object.defineProperty(engine.wrappedJSObject, "identifier",
                           { value: "org.mozilla.testsearchsuggestions" });
 
     let p = promiseContentSearchChange(browser, engine.name);
     Services.search.currentEngine = engine;
@@ -209,17 +209,17 @@ add_task(function* () {
   });
 
   Services.prefs.clearUserPref("browser.rights.override");
 });
 
 add_task(function* () {
   info("Check POST search engine support");
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:newtab" }, function* (browser) {
+  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:home" }, function* (browser) {
     return new Promise(resolve => {
       let searchObserver = Task.async(function* search_observer(subject, topic, data) {
         let currEngine = Services.search.defaultEngine;
         let engine = subject.QueryInterface(Ci.nsISearchEngine);
         info("Observer: " + data + " for " + engine.name);
 
         if (data != "engine-added")
           return;
@@ -263,19 +263,19 @@ add_task(function* () {
       Services.obs.addObserver(searchObserver, "browser-search-engine-modified", false);
       Services.search.addEngine("http://test:80/browser/browser/base/content/test/general/POSTSearchEngine.xml",
                                 null, null, false);
     });
   });
 });
 
 add_task(function* () {
-  info("Make sure that a page can't imitate about:newtab");
+  info("Make sure that a page can't imitate about:home");
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:newtab" }, function* (browser) {
+  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:home" }, function* (browser) {
     let promise = BrowserTestUtils.browserLoaded(browser);
     browser.loadURI("https://example.com/browser/browser/base/content/test/general/test_bug959531.html");
     yield promise;
 
     yield ContentTask.spawn(browser, null, function* () {
       let button = content.document.getElementById("settings");
       ok(button, "Found settings button in test page");
       button.click();
@@ -302,17 +302,17 @@ add_task(function* () {
     });
   });
 });
 
 add_task(function* () {
   // See browser_contentSearchUI.js for comprehensive content search UI tests.
   info("Search suggestion smoke test");
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:newtab" }, function* (browser) {
+  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:home" }, function* (browser) {
     // Add a test engine that provides suggestions and switch to it.
     let currEngine = Services.search.currentEngine;
     let engine = yield promiseNewEngine("searchSuggestionEngine.xml");
     let p = promiseContentSearchChange(browser, engine.name);
     Services.search.currentEngine = engine;
     yield p;
 
     yield ContentTask.spawn(browser, null, function* () {
@@ -361,17 +361,17 @@ add_task(function* () {
       Services.search.removeEngine(engine);
     } catch (ex) { }
   });
 });
 
 add_task(function* () {
   info("Clicking suggestion list while composing");
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:newtab" }, function* (browser) {
+  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:home" }, function* (browser) {
     // Add a test engine that provides suggestions and switch to it.
     let currEngine = Services.search.currentEngine;
     let engine = yield promiseNewEngine("searchSuggestionEngine.xml");
     let p = promiseContentSearchChange(browser, engine.name);
     Services.search.currentEngine = engine;
     yield p;
 
     yield ContentTask.spawn(browser, null, function* () {
@@ -449,17 +449,17 @@ add_task(function* () {
       Services.search.removeEngine(engine);
     } catch (ex) { }
   });
 });
 
 add_task(function* () {
   info("Pressing any key should focus the search box in the page, and send the key to it");
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:newtab" }, function* (browser) {
+  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:home" }, function* (browser) {
     yield BrowserTestUtils.synthesizeMouseAtCenter("#brandLogo", {}, browser);
 
     yield ContentTask.spawn(browser, null, function* () {
       let doc = content.document;
       isnot(doc.getElementById("searchText"), doc.activeElement,
         "Search input should not be the active element.");
     });
 
@@ -476,17 +476,17 @@ add_task(function* () {
 });
 
 add_task(function* () {
   info("Cmd+k should focus the search box in the page when the search box in the toolbar is absent");
 
   // Remove the search bar from toolbar
   CustomizableUI.removeWidgetFromArea("search-container");
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:newtab" }, function* (browser) {
+  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:home" }, function* (browser) {
     yield BrowserTestUtils.synthesizeMouseAtCenter("#brandLogo", {}, browser);
     yield ContentTask.spawn(browser, null, function* () {
       let doc = content.document;
       isnot(doc.getElementById("searchText"), doc.activeElement,
         "Search input should not be the active element.");
     });
 
     EventUtils.synthesizeKey("k", { accelKey: true });
@@ -501,33 +501,33 @@ add_task(function* () {
   });
 
   CustomizableUI.reset();
 });
 
 add_task(function* () {
   info("Cmd+k should focus the search box in the toolbar when it's present");
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:newtab" }, function* (browser) {
+  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:home" }, function* (browser) {
     yield BrowserTestUtils.synthesizeMouseAtCenter("#brandLogo", {}, browser);
 
     let doc = window.document;
     let searchInput = doc.getElementById("searchbar").textbox.inputField;
     isnot(searchInput, doc.activeElement, "Search bar should not be the active element.");
 
     EventUtils.synthesizeKey("k", { accelKey: true });
     yield promiseWaitForCondition(() => doc.activeElement === searchInput);
     is(searchInput, doc.activeElement, "Search bar should be the active element.");
   });
 });
 
 add_task(function* () {
   info("Sync button should open about:preferences#sync");
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:newtab" }, function* (browser) {
+  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:home" }, function* (browser) {
     let oldOpenPrefs = window.openPreferences;
     let openPrefsPromise = new Promise(resolve => {
       window.openPreferences = function (pane, params) {
         resolve({ pane: pane, params: params });
       };
     });
 
     yield BrowserTestUtils.synthesizeMouseAtCenter("#sync", {}, browser);
@@ -544,17 +544,17 @@ add_task(function* () {
 add_task(function* () {
   info("Pressing Space while the Addons button is focused should activate it");
 
   // Skip this test on Mac, because Space doesn't activate the button there.
   if (AppConstants.platform == "macosx") {
     return;
   }
 
-  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:newtab" }, function* (browser) {
+  yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:home" }, function* (browser) {
     info("Waiting for about:addons tab to open...");
     let promiseTabOpened = BrowserTestUtils.waitForNewTab(gBrowser, "about:addons");
 
     yield ContentTask.spawn(browser, null, function* () {
       let addOnsButton = content.document.getElementById("addons");
       addOnsButton.focus();
     });
     yield BrowserTestUtils.synthesizeKey(" ", {}, browser);
@@ -641,19 +641,19 @@ function* withSnippetsMap(setupFn, testF
         },
         onProgressChange() {},
         onStatusChange() {},
         onSecurityChange() {}
       };
       gBrowser.addProgressListener(wpl);
     });
 
-    // Set the URL to 'about:newtab' here to allow capturing the 'AboutHomeLoadSnippets'
+    // Set the URL to 'about:home' here to allow capturing the 'AboutHomeLoadSnippets'
     // event.
-    browser.loadURI("about:newtab");
+    browser.loadURI("about:home");
     // Wait for LocationChange.
     yield promise;
 
     yield ContentTask.spawn(browser, testArgs, testFn);
     if (parentFn) {
       yield parentFn();
     }
   });