spec: isolate sw file scheme spec storage with temp partition
This commit is contained in:
parent
8e07e7483f
commit
c3bcb606a9
1 changed files with 7 additions and 2 deletions
|
@ -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())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue