Merge pull request #12241 from electron/sw-file-scheme-flaky-patch
spec: isolate sw file scheme spec storage with temp partition
This commit is contained in:
commit
5a81cfbbc6
1 changed files with 7 additions and 2 deletions
|
@ -134,7 +134,12 @@ 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()
|
||||
|
@ -142,7 +147,7 @@ describe('chromium feature', () => {
|
|||
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())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue