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

Unified Diff: chrome/test/data/indexeddb/perf_shared.js

Issue 10836063: Add deletion test, cursor read with writeback to same store. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add bug number. Created 8 years, 5 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 | « no previous file | chrome/test/data/indexeddb/perf_test.js » ('j') | chrome/test/data/indexeddb/perf_test.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/indexeddb/perf_shared.js
diff --git a/chrome/test/data/indexeddb/perf_shared.js b/chrome/test/data/indexeddb/perf_shared.js
index f335b0b5855b290d422efaa4a7305e481d37394a..a831f65b5f0043b0ec7a5bb94e3398c30b963aa6 100644
--- a/chrome/test/data/indexeddb/perf_shared.js
+++ b/chrome/test/data/indexeddb/perf_shared.js
@@ -332,8 +332,12 @@ function getValuesFromCursor(
if (cursor) {
assert(numReadsLeft);
--numReadsLeft;
- if (oos) // Put in random order for maximum difficulty.
- oos.put(cursor.value, Math.random());
+ if (oos)
+ // Put in random order for maximum difficulty. We add in numKeys just
+ // in case we're writing back to the same store; this way we won't
+ // affect the number of keys available to the cursor, since we're always
+ // outside its range.
+ oos.put(cursor.value, numKeys + Math.random());
values.push({key: cursor.key, value: cursor.value});
cursor.continue();
} else {
« no previous file with comments | « no previous file | chrome/test/data/indexeddb/perf_test.js » ('j') | chrome/test/data/indexeddb/perf_test.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698