diff --git a/spec/chromium-spec.js b/spec/chromium-spec.js index 5cf0645699862..e748ee1009690 100644 --- a/spec/chromium-spec.js +++ b/spec/chromium-spec.js @@ -937,6 +937,23 @@ describe('chromium feature', () => { }) describe('storage', () => { + describe('DOM storage quota override', () => { + ['localStorage', 'sessionStorage'].forEach((storageName) => { + it(`can store at least 50MiB in ${storageName}`, (done) => { + assert.doesNotThrow(() => { + 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('') + assert.strictEqual(storage[testKeyName].length, arraySize) + delete storage[testKeyName] + done() + }) + }) + }) + }) + it('requesting persitent quota works', (done) => { navigator.webkitPersistentStorage.requestQuota(1024 * 1024, (grantedBytes) => { assert.strictEqual(grantedBytes, 1048576)