Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: content/test/data/indexeddb/write_20mb_blob.html

Issue 2855943003: Reduce the in-memory blob storgae limit on Android (Closed)
Patch Set: Fix IndexedDBBrowserTest. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <!--
4 Copyright 2014 The Chromium Authors. All rights reserved.
5 Use of this source code is governed by a BSD-style license that can be
6 found in the LICENSE file.
7 -->
8 <head>
9 <title>IDB Test that blobs use space when created and free up space when deleted </title>
10 <script src="common.js"></script>
11 <script>
12
13 // Constants.
14 var store_name = 'blobs';
15 var blob_key = 'blob_key';
16 var blob_size = 20 * 1024 * 1024; // 20MB
17
18 // Shared variables.
19 var db;
20
21 function test() {
22 indexedDBTest(prepareDatabase, putBlob);
23 }
24
25 function prepareDatabase() {
26 db = event.target.result;
27 db.createObjectStore(store_name);
28 }
29
30 function putBlob() {
31 debug("Writing blob.");
32
33 var trans = db.transaction(store_name, 'readwrite');
34 trans.onabort = unexpectedAbortCallback;
35 trans.oncomplete = done;
36
37 var data = new Array(1 + blob_size).join("X");
38 var blob = new Blob([data]);
39 var request = trans.objectStore(store_name).put(blob, blob_key);
40 request.onerror = unexpectedErrorCallback;
41 }
42
43 </script>
44 </head>
45 <body onLoad="test()">
46 <div id="status">Starting...<br></div>
47 </body>
48 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698