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 { |