docs: fix some string union type (#39258)

* docs: fix some string union types

Improve Type Union Typings in the Docs

* test: add smoke tests

* test: update `ses.clearStorageData` test case

* test: update `ses.clearStorageData` test case

---------

Co-authored-by: mhli <mhli@hillinsight.com>
This commit is contained in:
hunter 2023-07-31 16:32:59 +08:00 committed by GitHub
parent 6df392162f
commit 2b283724ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 11 deletions

View file

@ -252,12 +252,11 @@ describe('session module', () => {
it('clears localstorage data', async () => {
const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true } });
await w.loadFile(path.join(fixtures, 'api', 'localstorage.html'));
const options = {
await w.webContents.session.clearStorageData({
origin: 'file://',
storages: ['localstorage'],
quotas: ['persistent']
};
await w.webContents.session.clearStorageData(options);
quotas: ['temporary']
});
while (await w.webContents.executeJavaScript('localStorage.length') !== 0) {
// The storage clear isn't instantly visible to the renderer, so keep
// trying until it is.