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

This commit is contained in:
Shelley Vohr 2020-08-18 09:31:24 -07:00 committed by GitHub
parent a1eceee48f
commit ff24caf798
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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