GPU workaround to simulate Out of Memory errors with large textures
[chromium-blink-merge.git] / content / test / data / indexeddb / write_20mb_blob.html
blob70720d6ea74c3334427d7b3b69e8a2ed0960c007
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>
13 // Constants.
14 var store_name = 'blobs';
15 var blob_key = 'blob_key';
16 var blob_size = 20 * 1024 * 1024; // 20MB
18 // Shared variables.
19 var db;
21 function test() {
22 indexedDBTest(prepareDatabase, putBlob);
25 function prepareDatabase() {
26 db = event.target.result;
27 db.createObjectStore(store_name);
30 function putBlob() {
31 debug("Writing blob.");
33 var trans = db.transaction(store_name, 'readwrite');
34 trans.onabort = unexpectedAbortCallback;
35 trans.oncomplete = done;
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;
43 </script>
44 </head>
45 <body onLoad="test()">
46 <div id="status">Starting...<br></div>
47 </body>
48 </html>