| 25 | // always returns {} for every key, which only ever exercises the new-install |
| 26 | // branch. |
| 27 | function seedStorage(initial = {}) { |
| 28 | const store = {...initial}; |
| 29 | chrome.storage.local.get.mockImplementation(key => |
| 30 | Promise.resolve(key in store ? {[key]: store[key]} : {})); |
| 31 | chrome.storage.local.set.mockImplementation(obj => { |
| 32 | Object.assign(store, obj); |
| 33 | return Promise.resolve(); |
| 34 | }); |
| 35 | return store; |
| 36 | } |
| 37 | |
| 38 | const SEEDED_WATCH_LIST = [ |
| 39 | {site: 'Example', active: true, https_only: true, frames: [{scan: true, frame: '*.example.com', api: true}]} |