From 526c10a89dc3ed268a0ff820bd9749d0a3952316 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Mon, 7 Oct 2019 17:05:09 +0000 Subject: [PATCH] Bug 1578381 - Rename HomePage.init to delayedStartup to better describe when it gets called normally. r=mixedpuppy Depends on D48169 Differential Revision: https://phabricator.services.mozilla.com/D48195 --HG-- extra : moz-landing-system : lando --- browser/base/content/browser.js | 2 +- browser/modules/HomePage.jsm | 6 +++--- browser/modules/test/unit/test_HomePage_ignore.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 62f8902b3c75..008bc29e56c1 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -2072,7 +2072,7 @@ var gBrowserInit = { BrowserSearch.delayedStartupInit(); AutoShowBookmarksToolbar.init(); gProtectionsHandler.init(); - HomePage.init().catch(Cu.reportError); + HomePage.delayedStartup().catch(Cu.reportError); let safeMode = document.getElementById("helpSafeMode"); if (Services.appinfo.inSafeMode) { diff --git a/browser/modules/HomePage.jsm b/browser/modules/HomePage.jsm index 22b93e80ede9..ad79ffa42684 100644 --- a/browser/modules/HomePage.jsm +++ b/browser/modules/HomePage.jsm @@ -71,7 +71,7 @@ let HomePage = { * homepage, but this is deemed acceptable, as we'll correct it once * initialised. */ - async init() { + async delayedStartup() { if (this._initializationPromise) { await this._initializationPromise; return; @@ -178,7 +178,7 @@ let HomePage = { * `|` separated list of URLs. */ async set(value) { - await this.init(); + await this.delayedStartup(); if (await this.shouldIgnore(value)) { Cu.reportError( @@ -234,7 +234,7 @@ let HomePage = { * True if the url should be ignored. */ async shouldIgnore(url) { - await this.init(); + await this.delayedStartup(); const lowerURL = url.toLowerCase(); return this._ignoreList.some(code => lowerURL.includes(code.toLowerCase())); diff --git a/browser/modules/test/unit/test_HomePage_ignore.js b/browser/modules/test/unit/test_HomePage_ignore.js index 1cffbdf5e179..72ab0b0bd31f 100644 --- a/browser/modules/test/unit/test_HomePage_ignore.js +++ b/browser/modules/test/unit/test_HomePage_ignore.js @@ -44,7 +44,7 @@ add_task(async function test_initWithIgnoredPageCausesReset() { ); Assert.ok(HomePage.overridden, "Should have overriden the homepage"); - await HomePage.init(); + await HomePage.delayedStartup(); Assert.ok( !HomePage.overridden,