Skip to content

Commit

Permalink
spec: isolate sw file scheme spec storage with temp partition
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak1556 committed Mar 13, 2018
1 parent 8e07e74 commit c3bcb60
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spec/chromium-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,20 @@ describe('chromium feature', () => {

describe('navigator.serviceWorker', () => {
it('should register for file scheme', (done) => {
w = new BrowserWindow({ show: false })
w = new BrowserWindow({
show: false,
webPreferences: {
partition: 'sw-file-scheme-spec'
}
})
w.webContents.on('ipc-message', (event, args) => {
if (args[0] === 'reload') {
w.webContents.reload()
} else if (args[0] === 'error') {
done(args[1])
} else if (args[0] === 'response') {
assert.equal(args[1], 'Hello from serviceWorker!')
session.defaultSession.clearStorageData({
session.fromPartition('sw-file-scheme-spec').clearStorageData({
storages: ['serviceworkers']
}, () => done())
}
Expand Down

0 comments on commit c3bcb60

Please sign in to comment.