diff --git a/app/extensions/brave/locales/en-US/preferences.properties b/app/extensions/brave/locales/en-US/preferences.properties
index f6cbd29f1e7..a00cefdf56c 100644
--- a/app/extensions/brave/locales/en-US/preferences.properties
+++ b/app/extensions/brave/locales/en-US/preferences.properties
@@ -142,6 +142,7 @@ newTabHomePage=Home page
newTabDefaultSearchEngine=Default search engine
newTabEmpty=Blank page
myHomepage=My home page is
+multipleHomePages.title=Multiple home pages
aboutBlank=about:blank
default=Default
searchEngine=Search Engine
diff --git a/js/about/preferences.js b/js/about/preferences.js
index f7cc4c5e2ef..f28b9e8a406 100644
--- a/js/about/preferences.js
+++ b/js/about/preferences.js
@@ -683,7 +683,14 @@ class GeneralTab extends ImmutableComponent {
-
+
+
+
+
+
{
// initialize frames state
let frames = []
- if (frameOpts) {
+ if (frameOpts && Object.keys(frameOpts).length > 0) {
if (frameOpts.forEach) {
frames = frameOpts
} else {
diff --git a/less/about/preferences.less b/less/about/preferences.less
index 78badb88b2d..980b3424d3d 100644
--- a/less/about/preferences.less
+++ b/less/about/preferences.less
@@ -317,7 +317,6 @@ span.settingsListCopy {
.settingsList {
.settingItem {
-
> *:not(.switchControl) {
margin-bottom: 10px;
min-width: 160px;
@@ -365,6 +364,22 @@ span.settingsListCopy {
.subtext {
font-size: 0.95em;
}
+
+ .iconTitle {
+ margin: 1.2em 2px 7px;
+ color: #444444;
+ font-size: 0.9em;
+
+ span {
+ display: inline-block;
+ }
+
+ .iconLink {
+ margin-left: 5px;
+ cursor: pointer;
+ vertical-align: middle;
+ }
+ }
}
input[type="checkbox"][disabled] {
diff --git a/test/about/newTabTest.js b/test/about/newTabTest.js
index f0d1c35f292..7ba014813f5 100644
--- a/test/about/newTabTest.js
+++ b/test/about/newTabTest.js
@@ -6,6 +6,7 @@ const {getTargetAboutUrl} = require('../../js/lib/appUrlUtil')
const settings = require('../../js/constants/settings')
const {newTabMode} = require('../../app/common/constants/settingsEnums')
const aboutNewTabUrl = getTargetAboutUrl('about:newtab')
+const messages = require('../../js/constants/messages')
describe('about:newtab tests', function () {
function * setup (client) {
@@ -87,6 +88,25 @@ describe('about:newtab tests', function () {
})
})
+ describe('with NEWTAB_MODE === HOMEPAGE', function () {
+ const page1 = 'https://start.duckduckgo.com/'
+ const page2 = 'https://brave.com/'
+
+ Brave.beforeAll(this)
+
+ before(function * () {
+ yield setup(this.app.client)
+ yield this.app.client.changeSetting(settings.NEWTAB_MODE, newTabMode.HOMEPAGE)
+ yield this.app.client.changeSetting(settings.HOMEPAGE, `${page1}|${page2}`)
+ })
+
+ it('multiple homepages', function * () {
+ yield this.app.client
+ .ipcSend(messages.SHORTCUT_NEW_FRAME)
+ .waitForUrl(page1)
+ })
+ })
+
describe.skip('with NEWTAB_MODE === NEW_TAB_PAGE', function () {
describe('page content', function () {
Brave.beforeAll(this)
diff --git a/test/about/preferencesTest.js b/test/about/preferencesTest.js
index ca46fba8b9d..45845d6ee60 100644
--- a/test/about/preferencesTest.js
+++ b/test/about/preferencesTest.js
@@ -1,7 +1,9 @@
-/* global describe, it, beforeEach */
+/* global describe, it, beforeEach, before, after */
const Brave = require('../lib/brave')
const {urlInput, homepageInput} = require('../lib/selectors')
+const settings = require('../../js/constants/settings')
+const {startsWithOption, newTabMode} = require('../../app/common/constants/settingsEnums')
const prefsUrl = 'about:preferences'
@@ -12,6 +14,10 @@ function * setup (client) {
.waitForVisible(urlInput)
}
+function * setupBrave (client) {
+ Brave.addCommands()
+}
+
describe('General Panel', function () {
describe('homepage', function () {
Brave.beforeEach(this)
@@ -33,4 +39,41 @@ describe('General Panel', function () {
})
})
})
+
+ describe('homepage multiple', function () {
+ Brave.beforeAllServerSetup(this)
+
+ before(function * () {
+ yield Brave.startApp()
+ yield setupBrave(Brave.app.client)
+ })
+
+ it('from scratch', function * () {
+ const page1 = 'https://start.duckduckgo.com/'
+ const page2 = 'https://brave.com/'
+
+ yield Brave.app.client.changeSetting(settings.STARTUP_MODE, startsWithOption.HOMEPAGE)
+ // TODO remove when #6920 is fixed
+ yield Brave.app.client.changeSetting(settings.NEWTAB_MODE, newTabMode.HOMEPAGE)
+ yield Brave.app.client.changeSetting(settings.HOMEPAGE, `${page1}|${page2}`)
+
+ yield Brave.stopApp(false)
+ yield Brave.startApp()
+ yield setupBrave(Brave.app.client)
+ yield Brave.app.client
+ .waitForBrowserWindow()
+ .waitUntil(function () {
+ return this.getWindowState().then((val) => {
+ return (val.value.tabs.length === 2 &&
+ val.value.tabs[0].location === page1 &&
+ val.value.tabs[1].location === page2
+ )
+ })
+ })
+ })
+
+ after(function * () {
+ yield Brave.stopApp()
+ })
+ })
})