[refactor] More post-NSS WebCrypto cleanups (utility functions).
[chromium-blink-merge.git] / content / test / data / indexeddb / getall_max_message_size.html
blob3b35a02bf63d453190426308bceeb5137fc6cea3
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>
13 function test() {
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);
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();
35 request.onsuccess = unexpectedSuccessCallback;
36 request.onerror = function(e) {
37 shouldBeEqualToString('request.error.name', 'UnknownError');
40 tx.oncomplete = unexpectedCompleteCallback;
41 tx.onabort = done;
44 </script>
45 </head>
46 <body onLoad="test()">
47 <div id="status">Starting...</div>
48 </body>
49 </html>