From c3bcb606a9fdb3593612e2bd6d81ac76f8a8b39e Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Wed, 14 Mar 2018 02:03:55 +0900 Subject: [PATCH] spec: isolate sw file scheme spec storage with temp partition --- spec/chromium-spec.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/chromium-spec.js b/spec/chromium-spec.js index 0de32fec86c2..3d1d3f673592 100644 --- a/spec/chromium-spec.js +++ b/spec/chromium-spec.js @@ -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()) }