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

Commit ff42cbc

Browse files
committed
Add more navbar focus tests
Also a small tweak for the nettab url. Fix #5563
1 parent 7f1d0a2 commit ff42cbc

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

js/components/frame.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ class Frame extends ImmutableComponent {
10321032
appActions.hideMessageBox(message)
10331033
}
10341034
this.notificationCallbacks = {}
1035-
const isNewTabPage = e.url === getTargetAboutUrl('about:newtab')
1035+
const isNewTabPage = getBaseUrl(e.url) === getTargetAboutUrl('about:newtab')
10361036
if (isNewTabPage) {
10371037
windowActions.setUrlBarActive(true)
10381038
windowActions.setUrlBarFocused(true)

test/components/navigationBarTest.js

+23
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,29 @@ describe('navigationBar', function () {
8484
.keys(Brave.keys.ENTER)
8585
.waitForElementFocus(activeWebview)
8686
})
87+
88+
it('newtab hasfocus in urlbar', function * () {
89+
yield this.app.client
90+
.ipcSend(messages.SHORTCUT_NEW_FRAME)
91+
.waitUntil(function () {
92+
return this.getWindowState().then((val) => {
93+
return val.value.frames.length === 2
94+
})
95+
})
96+
.waitForElementFocus(urlInput)
97+
.ipcSend(messages.SHORTCUT_CLOSE_FRAME, 2)
98+
})
99+
it('newtab with page has focus in webview', function * () {
100+
var page1Url = Brave.server.url('tabnapping.html')
101+
yield this.app.client
102+
.ipcSend(messages.SHORTCUT_NEW_FRAME, page1Url)
103+
.waitUntil(function () {
104+
return this.getWindowState().then((val) => {
105+
return val.value.frames.length === 2
106+
})
107+
})
108+
.waitForElementFocus(activeWebview)
109+
})
87110
})
88111
describe('tabnapping', function () {
89112
Brave.beforeAll(this)

0 commit comments

Comments
 (0)