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

Commit

Permalink
Blocked count should not update for background tabs
Browse files Browse the repository at this point in the history
Fix #11400

Auditors: @bsclifton
  • Loading branch information
bbondy committed Oct 11, 2017
1 parent 987d664 commit c0aea8f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/renderer/components/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ class Main extends React.Component {
})

ipc.on(messages.BLOCKED_RESOURCE, (e, blockType, details) => {
windowActions.setBlockedBy(this.props.tabId, blockType, details.url)
windowActions.setBlockedBy(details.tabId, blockType, details.url)
})

ipc.on(messages.HTTPSE_RULE_APPLIED, (e, ruleset, details) => {
Expand Down
13 changes: 13 additions & 0 deletions test/bravery-components/braveryPanelTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ describe('Bravery Panel', function () {
.windowByUrl(Brave.browserWindowUrl)
.waitForTextValue('[data-test-id="lionBadge"]', '2')
})
it('lion badge does not update for background loads', function * () {
const url = Brave.server.url('tracking.html')
yield this.app.client
.waitForDataFile('trackingProtection')
.newTab({ url })
.waitForTabCount(2)
.windowByUrl(Brave.browserWindowUrl)
.newTab({ url })
.waitForTabCount(3)
.windowByUrl(Brave.browserWindowUrl)
.ipcSend('blocked-resource', 'adblock', { url, tabId: 5 })
.waitForTextValue('[data-test-id="lionBadge"]', '2')
})
})
describe('Tracking Protection stats', function () {
Brave.beforeEach(this)
Expand Down

0 comments on commit c0aea8f

Please sign in to comment.