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:
John Kleinschmidt 2018-03-13 13:30:43 -04:00 committed by GitHub
commit 5a81cfbbc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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())
}