Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2312)

Unified Diff: content/test/data/indexeddb/getall_max_message_size.html

Issue 1321583002: IndexedDB: Make getAll() requests fail if result exceeds IPC limits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename constant Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/indexed_db/indexed_db_constants.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/indexeddb/getall_max_message_size.html
diff --git a/content/test/data/indexeddb/getall_max_message_size.html b/content/test/data/indexeddb/getall_max_message_size.html
new file mode 100644
index 0000000000000000000000000000000000000000..3b35a02bf63d453190426308bceeb5137fc6cea3
--- /dev/null
+++ b/content/test/data/indexeddb/getall_max_message_size.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<!--
+ Copyright 2015 The Chromium Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style license that can be
+ found in the LICENSE file.
+-->
+<head>
+<title>IDB Test that getAll() results exceeding IPC message size result in error</title>
+<script src="common.js"></script>
+<script>
+
+function test() {
+ indexedDBTest(prepareDatabase, runTest);
+}
+
+function prepareDatabase(event) {
+ var db = event.target.result;
+ var store = db.createObjectStore('store');
+
+ var ten_kilobytes = new Uint8Array(10 * 1024);
+
+ // 20MB total; in browser tests, the message limit is 10MB
+ for (var i = 0; i < 2000; ++i) {
+ store.put(ten_kilobytes, i);
+ }
+}
+
+var tx, request;
+function runTest(event) {
+ var db = event.target.result;
+ tx = db.transaction('store');
+ request = tx.objectStore('store').getAll();
+
+ request.onsuccess = unexpectedSuccessCallback;
+ request.onerror = function(e) {
+ shouldBeEqualToString('request.error.name', 'UnknownError');
+ };
+
+ tx.oncomplete = unexpectedCompleteCallback;
+ tx.onabort = done;
+}
+
+</script>
+</head>
+<body onLoad="test()">
+ <div id="status">Starting...</div>
+</body>
+</html>
« no previous file with comments | « content/common/indexed_db/indexed_db_constants.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698