spec: isolate sw file scheme spec storage with temp partition

This commit is contained in:
deepak1556 2018-03-14 02:03:55 +09:00
parent 8e07e7483f
commit c3bcb606a9

View file

@ -134,7 +134,12 @@ describe('chromium feature', () => {
describe('navigator.serviceWorker', () => { describe('navigator.serviceWorker', () => {
it('should register for file scheme', (done) => { 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) => { w.webContents.on('ipc-message', (event, args) => {
if (args[0] === 'reload') { if (args[0] === 'reload') {
w.webContents.reload() w.webContents.reload()
@ -142,7 +147,7 @@ describe('chromium feature', () => {
done(args[1]) done(args[1])
} else if (args[0] === 'response') { } else if (args[0] === 'response') {
assert.equal(args[1], 'Hello from serviceWorker!') assert.equal(args[1], 'Hello from serviceWorker!')
session.defaultSession.clearStorageData({ session.fromPartition('sw-file-scheme-spec').clearStorageData({
storages: ['serviceworkers'] storages: ['serviceworkers']
}, () => done()) }, () => done())
} }