fix: bypass DOM storage quota (#15596)
This commit is contained in:
parent
c9d0960f47
commit
b21dbdb20d
4 changed files with 113 additions and 24 deletions
|
@ -938,6 +938,20 @@ describe('chromium feature', () => {
|
|||
})
|
||||
|
||||
describe('storage', () => {
|
||||
describe('DOM storage quota override', () => {
|
||||
['localStorage', 'sessionStorage'].forEach((storageName) => {
|
||||
it(`allows saving at least 50MiB in ${storageName}`, () => {
|
||||
const storage = window[storageName]
|
||||
const testKeyName = '_electronDOMStorageQuotaOverrideTest'
|
||||
// 25 * 2^20 UTF-16 characters will require 50MiB
|
||||
const arraySize = 25 * Math.pow(2, 20)
|
||||
storage[testKeyName] = new Array(arraySize).fill('X').join('')
|
||||
expect(storage[testKeyName]).to.have.lengthOf(arraySize)
|
||||
delete storage[testKeyName]
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('requesting persitent quota works', (done) => {
|
||||
navigator.webkitPersistentStorage.requestQuota(1024 * 1024, (grantedBytes) => {
|
||||
assert.strictEqual(grantedBytes, 1048576)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue