diff options
author | sullivan@chromium.org <sullivan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-19 16:11:44 +0000 |
---|---|---|
committer | sullivan@chromium.org <sullivan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-19 16:11:44 +0000 |
commit | 46e38bfb75d6248d66a3c29a3ba1d51f3c78a3e0 (patch) | |
tree | cd2d485402130179ffda610719475ab0d8af7c96 /tools/page_cycler | |
parent | aa3311a04298a8de632cee9e8260c405babe1e4c (diff) | |
download | chromium_src-46e38bfb75d6248d66a3c29a3ba1d51f3c78a3e0.zip chromium_src-46e38bfb75d6248d66a3c29a3ba1d51f3c78a3e0.tar.gz chromium_src-46e38bfb75d6248d66a3c29a3ba1d51f3c78a3e0.tar.bz2 |
Revert 168392 - Remove setVersion from IndexedDB page cycler
BUG=161542
Review URL: https://chromiumcodereview.appspot.com/11348104
TBR=dgrogan@chromium.org
Review URL: https://codereview.chromium.org/11348131
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168535 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/page_cycler')
-rw-r--r-- | tools/page_cycler/indexed_db/basic_insert/index.html | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/tools/page_cycler/indexed_db/basic_insert/index.html b/tools/page_cycler/indexed_db/basic_insert/index.html index 9c2f888..b57f9cc 100644 --- a/tools/page_cycler/indexed_db/basic_insert/index.html +++ b/tools/page_cycler/indexed_db/basic_insert/index.html @@ -21,24 +21,28 @@ if (!setup()) testComplete(SETUP_FAILED); - var request = indexedDB.deleteDatabase('idb_basic_insert'); - request.onsuccess = onDelete; + var request = indexedDB.open('idb_basic_insert'); + request.onsuccess = onOpen; request.onerror = error; - request.onblocked = error; } - function onDelete() { - request = indexedDB.open('idb_basic_insert'); - request.onblocked = error; + function onOpen() { + // TODO(jorlow): Remove the old non-event.target part. + window.db = event.result || event.target.result; + + var request = db.setVersion('1'); request.onerror = error; - request.onupgradeneeded = onSetVersion; - request.onsuccess = storeCreated; + request.onsuccess = onSetVersion; } function onSetVersion() { - db = event.target.result; - var transaction = event.target.transaction; + // TODO(jorlow): Remove the old non-event.target part. + var transaction = event.result || event.target.result; transaction.onerror = error; + transaction.oncomplete = storeCreated; + + while (db.objectStoreNames.length) + db.deleteObjectStore(db.objectStoreNames[0]); db.createObjectStore('store'); } |