test: use custom partition for sw tests (#25020)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot]
2020-08-19 12:17:58 -04:00
committed by GitHub
parent e9c9a6f177
commit af59f68281

View File

@@ -447,7 +447,8 @@ describe('chromium features', () => {
show: false,
webPreferences: {
nodeIntegration: true,
nodeIntegrationInWorker: true
nodeIntegrationInWorker: true,
partition: 'sw-file-scheme-worker-spec'
}
});
@@ -458,7 +459,9 @@ describe('chromium features', () => {
done(`unexpected error : ${message}`);
} else if (channel === 'response') {
expect(message).to.equal('Hello from serviceWorker!');
done();
session.fromPartition('sw-file-scheme-worker-spec').clearStorageData({
storages: ['serviceworkers']
}).then(() => done());
}
});