| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <!-- | 3 <!-- |
| 4 Copyright 2014 The Chromium Authors. All rights reserved. | 4 Copyright 2017 The Chromium Authors. All rights reserved. |
| 5 Use of this source code is governed by a BSD-style license that can be | 5 Use of this source code is governed by a BSD-style license that can be |
| 6 found in the LICENSE file. | 6 found in the LICENSE file. |
| 7 --> | 7 --> |
| 8 <head> | 8 <head> |
| 9 <title>IDB Test that blobs use space when created and free up space when deleted
</title> | 9 <title>IDB Test that blobs use space when created and free up space when deleted
</title> |
| 10 <script src="common.js"></script> | 10 <script src="common.js"></script> |
| 11 <script> | 11 <script> |
| 12 | 12 |
| 13 // Constants. | 13 // Constants. |
| 14 var store_name = 'blobs'; | 14 var store_name = 'blobs'; |
| 15 var blob_key = 'blob_key'; | 15 var blob_key = 'blob_key'; |
| 16 var blob_size = 20 * 1024 * 1024; // 20MB | 16 var blob_size = 4 * 1024 * 1024; // 4MB |
| 17 | 17 |
| 18 // Shared variables. | 18 // Shared variables. |
| 19 var db; | 19 var db; |
| 20 | 20 |
| 21 function test() { | 21 function test() { |
| 22 indexedDBTest(prepareDatabase, putBlob); | 22 indexedDBTest(prepareDatabase, putBlob); |
| 23 } | 23 } |
| 24 | 24 |
| 25 function prepareDatabase() { | 25 function prepareDatabase() { |
| 26 db = event.target.result; | 26 db = event.target.result; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 39 var request = trans.objectStore(store_name).put(blob, blob_key); | 39 var request = trans.objectStore(store_name).put(blob, blob_key); |
| 40 request.onerror = unexpectedErrorCallback; | 40 request.onerror = unexpectedErrorCallback; |
| 41 } | 41 } |
| 42 | 42 |
| 43 </script> | 43 </script> |
| 44 </head> | 44 </head> |
| 45 <body onLoad="test()"> | 45 <body onLoad="test()"> |
| 46 <div id="status">Starting...<br></div> | 46 <div id="status">Starting...<br></div> |
| 47 </body> | 47 </body> |
| 48 </html> | 48 </html> |
| OLD | NEW |