17 lines
2.3 KiB
JavaScript
17 lines
2.3 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.CdpStoragesProvider = void 0;
|
|
const get_active_client_1 = require("./utils/get-active-client");
|
|
const base_1 = require("../test-run/storages/base");
|
|
class CdpStoragesProvider extends base_1.StoragesProviderBase {
|
|
async _getCdpClient() {
|
|
const browserConnection = this.testRun.browserConnection;
|
|
return (0, get_active_client_1.getActiveClient)(browserConnection);
|
|
}
|
|
async clearStorages() {
|
|
const client = await this._getCdpClient();
|
|
await client.Storage.clearDataForOrigin({ origin: '*', storageTypes: 'all' });
|
|
}
|
|
}
|
|
exports.CdpStoragesProvider = CdpStoragesProvider;
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmFnZXMtcHJvdmlkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHJveHlsZXNzL3N0b3JhZ2VzLXByb3ZpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUNBLGlFQUE0RDtBQUM1RCxvREFBbUY7QUFFbkYsTUFBYSxtQkFBb0IsU0FBUSwyQkFBb0I7SUFDakQsS0FBSyxDQUFDLGFBQWE7UUFDdkIsTUFBTSxpQkFBaUIsR0FBRyxJQUFJLENBQUMsT0FBTyxDQUFDLGlCQUFpQixDQUFDO1FBRXpELE9BQU8sSUFBQSxtQ0FBZSxFQUFDLGlCQUFpQixDQUFDLENBQUM7SUFDOUMsQ0FBQztJQUVELEtBQUssQ0FBQyxhQUFhO1FBQ2YsTUFBTSxNQUFNLEdBQUcsTUFBTSxJQUFJLENBQUMsYUFBYSxFQUFFLENBQUM7UUFFMUMsTUFBTSxNQUFNLENBQUMsT0FBTyxDQUFDLGtCQUFrQixDQUFDLEVBQUUsTUFBTSxFQUFFLEdBQUcsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFFLENBQUMsQ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