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

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 onblocked handler for deleteDatabase 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') | no next file with comments »
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..43a5d308957c9cd07c73046bf95c079014c4dbdc 100644
--- a/chrome/test/data/indexeddb/perf_shared.js
+++ b/chrome/test/data/indexeddb/perf_shared.js
@@ -160,12 +160,13 @@ function getTransaction(db, objectStoreNames, mode, opt_handler) {
function deleteDatabase(name, opt_handler) {
var deleteRequest = indexedDB.deleteDatabase(name);
deleteRequest.onerror = onError;
+ deleteRequest.onblocked = onError;
if (opt_handler) {
deleteRequest.onsuccess = opt_handler;
}
}
-function getCompletionFunc(testName, startTime, onTestComplete) {
+function getCompletionFunc(db, testName, startTime, onTestComplete) {
function onDeleted() {
automation.setStatus("Deleted database.");
onTestComplete();
@@ -175,9 +176,8 @@ function getCompletionFunc(testName, startTime, onTestComplete) {
// Ignore the cleanup time for this test.
automation.addResult(testName, duration);
automation.setStatus("Deleting database.");
- // TODO(ericu): Turn on actual deletion; for now it's way too slow.
- // deleteDatabase(testName, onDeleted);
- onTestComplete();
+ db.close();
+ deleteDatabase(testName, onDeleted);
}
}
@@ -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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698