Browse Source

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

Shelley Vohr 4 years ago
parent
commit
ff24caf798
1 changed files with 5 additions and 2 deletions
  1. 5 2
      spec-main/chromium-spec.ts

+ 5 - 2
spec-main/chromium-spec.ts

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