From 041032360c4d3873ccbb20833cc52a105ed32872 Mon Sep 17 00:00:00 2001 From: yan Date: Thu, 27 Oct 2016 18:34:37 -0700 Subject: [PATCH] show about:blank in urlbar fix #5209 Auditors: @bbondy Test Plan: 1. go to about:blank, observe that it is shown in the urlbar 2. highlight urlbar and go to about:newtab, observe that it is now empty --- js/lib/urlutil.js | 2 +- test/components/navigationBarTest.js | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/js/lib/urlutil.js b/js/lib/urlutil.js index 1de02fb3116..177838add37 100644 --- a/js/lib/urlutil.js +++ b/js/lib/urlutil.js @@ -336,7 +336,7 @@ const UrlUtil = { * @return {string} */ getDisplayLocation: function (url, pdfjsEnabled) { - if (!url || ['about:blank', 'about:newtab'].includes(url)) { + if (!url || url === 'about:newtab') { return '' } const parsed = urlParse(pdfjsEnabled ? this.getLocationIfPDF(url) : url) diff --git a/test/components/navigationBarTest.js b/test/components/navigationBarTest.js index 58ff71eb679..3f38bb7f1b6 100644 --- a/test/components/navigationBarTest.js +++ b/test/components/navigationBarTest.js @@ -739,14 +739,22 @@ describe('navigationBar', function () { before(function * () { yield setup(this.app.client) yield this.app.client.waitForExist(urlInput) - yield this.app.client.keys('about:blank') - // hit enter - yield this.app.client.keys('\uE007') }) - it('hides the url', function * () { - yield this.app.client.waitUntil(function () { - return this.getValue(urlInput).then((val) => val === '') - }) + it('hides about:newtab', function * () { + yield this.app.client + .tabByUrl(this.newTabUrl) + .windowByUrl(Brave.browserWindowUrl) + .waitUntil(function () { + return this.getValue(urlInput).then((val) => val === '') + }) + }) + it('shows about:blank', function * () { + yield this.app.client + .keys('about:blank') + .keys('\uE007') + .waitUntil(function () { + return this.getValue(urlInput).then((val) => val === 'about:blank') + }) }) })