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

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

Issue 924033003: IndexedDB: Ensure that blobs in unused prefetches are acked (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak store name Created 5 years, 10 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/child/indexed_db/webidbcursor_impl.cc ('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/blob_did_ack_prefetch.html
diff --git a/content/test/data/indexeddb/blob_did_ack_prefetch.html b/content/test/data/indexeddb/blob_did_ack_prefetch.html
new file mode 100644
index 0000000000000000000000000000000000000000..333c2e95726be8b7431a4fb817ad969a753e6fe8
--- /dev/null
+++ b/content/test/data/indexeddb/blob_did_ack_prefetch.html
@@ -0,0 +1,56 @@
+<!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 unused cursor prefetches are acked back to browser process</title>
+<script src="common.js"></script>
+<script>
+
+// Constants.
+var store_name = 'prefetch_blobs_ack';
+var kNumToFetch = 15; // Enough to trigger prefetch, but not on a batch boundary.
+
+// Shared variables.
+var db;
+
+function test() {
+ indexedDBTest(prepareDatabase, iterateCursor);
+}
+
+function prepareDatabase() {
+ db = event.target.result;
+ var store = db.createObjectStore(store_name);
+ for (var i = 0; i < kNumToFetch + 10; ++i)
+ store.put(new Blob([String(i)]), i);
+}
+
+function iterateCursor() {
+ var tx = db.transaction(store_name, 'readonly');
+ var count = kNumToFetch;
+ var request = tx.objectStore(store_name).openCursor();
+ request.onerror = unexpectedErrorCallback;
+ request.onsuccess = function() {
+ if (--count > 0)
+ request.result.continue();
+ };
+ tx.onabort = unexpectedAbortCallback;
+ tx.oncomplete = onComplete;
+}
+
+function onComplete() {
+ gc();
+ done();
+}
+
+</script>
+</head>
+<body onLoad="test()">
+ <div id="status">Starting...<br>
+ <p>Run this test with --js-flags=--expose-gc when run from Chrome.</p>
+ </div>
+</body>
+</html>
« no previous file with comments | « content/child/indexed_db/webidbcursor_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698