Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
show about:blank in urlbar
Browse files Browse the repository at this point in the history
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
  • Loading branch information
diracdeltas committed Oct 28, 2016
1 parent 463c53d commit 0410323
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion js/lib/urlutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
22 changes: 15 additions & 7 deletions test/components/navigationBarTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
})
})

Expand Down

0 comments on commit 0410323

Please sign in to comment.