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.
9 <title>IDB Test that getAll() results exceeding IPC message size result in error
</title>
10 <script src=
"common.js"></script>
14 indexedDBTest(prepareDatabase
, runTest
);
17 function prepareDatabase(event
) {
18 var db
= event
.target
.result
;
19 var store
= db
.createObjectStore('store');
21 var ten_kilobytes
= new Uint8Array(10 * 1024);
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
);
30 function runTest(event
) {
31 var db
= event
.target
.result
;
32 tx
= db
.transaction('store');
33 request
= tx
.objectStore('store').getAll();
35 request
.onsuccess
= unexpectedSuccessCallback
;
36 request
.onerror = function(e
) {
37 shouldBeEqualToString('request.error.name', 'UnknownError');
40 tx
.oncomplete
= unexpectedCompleteCallback
;
46 <body onLoad=
"test()">
47 <div id=
"status">Starting...
</div>