Skip to content

Commit

Permalink
Merge pull request #40 from brave/fix_disabled_icon_path
Browse files Browse the repository at this point in the history
Fix icon paths used in setIcon
  • Loading branch information
cezaraugusto authored Jul 1, 2018
2 parents c17dadf + f0c7d83 commit bdf4ea1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ action("brave-extension") {
"$target_gen_dir/brave_extension/build/bravelizer.css",
"$target_gen_dir/brave_extension/build/img/icon-128.png",
"$target_gen_dir/brave_extension/build/img/icon-16.png",
"$target_gen_dir/brave_extension/build/img/icon-16-disabled.png",
"$target_gen_dir/brave_extension/build/img/icon-48.png",
"$target_gen_dir/brave_extension/build/_locales/en_US/messages.json",
]
Expand Down
4 changes: 2 additions & 2 deletions app/background/api/browserActionAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const setBadgeText = (text: string) => {
* Updates the shields icon based on shields state
*/
export const setIcon = (url: string, tabId: number, shieldsOn: boolean) => {
const shieldsEnabledIcon = '../../img/icon-16.png'
const shieldsDisabledIcon = '../../img/icon-16-disabled.png'
const shieldsEnabledIcon = 'img/icon-16.png'
const shieldsDisabledIcon = 'img/icon-16-disabled.png'
const isHttpOrHttps = url && /^http/.test(url)

if (chrome.browserAction) {
Expand Down
6 changes: 3 additions & 3 deletions test/app/background/api/browserActionAPITest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('BrowserAction API', () => {
})
after(function () {
this.spy.restore()
})
})
it('calls chrome.browserAction.setBadgeText with the text', function () {
assert(this.spy.calledOnce)
assert.deepEqual(this.spy.getCall(0).args[0], {
Expand All @@ -26,8 +26,8 @@ describe('BrowserAction API', () => {
})
})
describe('setIcon', function () {
const enabledIconPath = '../../img/icon-16.png'
const disabledIconPath = '../../img/icon-16-disabled.png'
const enabledIconPath = 'img/icon-16.png'
const disabledIconPath = 'img/icon-16-disabled.png'
before(function () {
this.spy = sinon.spy(chrome.browserAction, 'setIcon')
this.url = 'https://brave.com'
Expand Down

0 comments on commit bdf4ea1

Please sign in to comment.