OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <!-- |
| 4 Copyright 2015 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 getAll() results exceeding IPC message size result in error
</title> |
| 10 <script src="common.js"></script> |
| 11 <script> |
| 12 |
| 13 function test() { |
| 14 indexedDBTest(prepareDatabase, runTest); |
| 15 } |
| 16 |
| 17 function prepareDatabase(event) { |
| 18 var db = event.target.result; |
| 19 var store = db.createObjectStore('store'); |
| 20 |
| 21 var ten_kilobytes = new Uint8Array(10 * 1024); |
| 22 |
| 23 // 20MB total; in browser tests, the message limit is 10MB |
| 24 for (var i = 0; i < 2000; ++i) { |
| 25 store.put(ten_kilobytes, i); |
| 26 } |
| 27 } |
| 28 |
| 29 var tx, request; |
| 30 function runTest(event) { |
| 31 var db = event.target.result; |
| 32 tx = db.transaction('store'); |
| 33 request = tx.objectStore('store').getAll(); |
| 34 |
| 35 request.onsuccess = unexpectedSuccessCallback; |
| 36 request.onerror = function(e) { |
| 37 shouldBeEqualToString('request.error.name', 'UnknownError'); |
| 38 }; |
| 39 |
| 40 tx.oncomplete = unexpectedCompleteCallback; |
| 41 tx.onabort = done; |
| 42 } |
| 43 |
| 44 </script> |
| 45 </head> |
| 46 <body onLoad="test()"> |
| 47 <div id="status">Starting...</div> |
| 48 </body> |
| 49 </html> |
OLD | NEW |