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

Fixes back/forward history middle click #7893

Merged
merged 1 commit into from
Mar 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/contextMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,7 @@ function onBackButtonHistoryMenu (activeFrame, history, target) {
if (eventUtil.isForSecondaryAction(e)) {
windowActions.newFrame({
location: url,
partitionNumber: activeFrame.props.frame.get('partitionNumber')
partitionNumber: activeFrame.props.partitionNumber
}, !!e.shiftKey)
} else {
activeFrame.goToIndex(index)
Expand Down Expand Up @@ -1503,7 +1503,7 @@ function onForwardButtonHistoryMenu (activeFrame, history, target) {
if (eventUtil.isForSecondaryAction(e)) {
windowActions.newFrame({
location: url,
partitionNumber: activeFrame.props.frame.get('partitionNumber')
partitionNumber: activeFrame.props.partitionNumber
}, !!e.shiftKey)
} else {
activeFrame.goToIndex(index)
Expand Down
36 changes: 35 additions & 1 deletion test/tab-components/tabTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const Brave = require('../lib/brave')
const messages = require('../../js/constants/messages')
const assert = require('assert')
const settings = require('../../js/constants/settings')
const {urlInput, backButton, forwardButton, activeTab, activeTabTitle, activeTabFavicon, newFrameButton, notificationBar} = require('../lib/selectors')
const {urlInput, backButton, forwardButton, activeTab, activeTabTitle, activeTabFavicon, newFrameButton, notificationBar, contextMenu} = require('../lib/selectors')

describe('tab tests', function () {
function * setup (client) {
Expand Down Expand Up @@ -56,6 +56,40 @@ describe('tab tests', function () {
.then((title) => title === 'Page 2')
})
})

it('middle click opens in the new tab', function * () {
var page1 = Brave.server.url('page1.html')
var page2 = Brave.server.url('page2.html')

yield this.app.client
.tabByIndex(0)
.loadUrl(page1)
.windowByUrl(Brave.browserWindowUrl)
.waitUntil(function () {
return this.getText(activeTabTitle)
.then((title) => title === 'Page 1')
})
.tabByIndex(0)
.loadUrl(page2)
.windowByUrl(Brave.browserWindowUrl)
.waitUntil(function () {
return this.getText(activeTabTitle)
.then((title) => title === 'Page 2')
})
.waitForExist(backButton)
.click(backButton)
.waitForUrl(page1)
.windowByUrl(Brave.browserWindowUrl)
.waitUntil(function () {
return this.getText(activeTabTitle)
.then((title) => title === 'Page 1')
})
.waitForExist('.forwardButton')
.rightClick(forwardButton)
.waitForExist(contextMenu)
.middleClick(`${contextMenu} [data-index="0"]`)
.waitForTabCount(2)
})
})

describe('new tab signal', function () {
Expand Down