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

Unified Diff: LayoutTests/storage/indexeddb/metadata-race.html

Issue 14232020: Ensure IDB transactions started before success arrives see correct medata (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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 | LayoutTests/storage/indexeddb/metadata-race-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/storage/indexeddb/metadata-race.html
diff --git a/LayoutTests/storage/indexeddb/metadata-race.html b/LayoutTests/storage/indexeddb/metadata-race.html
new file mode 100644
index 0000000000000000000000000000000000000000..2ac0bc479445472ba391de0bb004ab802e81771b
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/metadata-race.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="resources/shared.js"></script>
+<script>
+
+description("Ensure IndexedDB transactions created before open onsuccess have correct metadata");
+
+indexedDBTest(prepareDatabase, onOpenSuccess);
+function prepareDatabase(evt)
+{
+ preamble(evt);
+ evalAndLog("db = event.target.result");
+ evalAndLog("store = db.createObjectStore('store')");
+ evalAndLog("store.createIndex('index', 'keyPath')");
+ evalAndLog("transaction = event.target.transaction");
+ shouldNotThrow("index = transaction.objectStore('store').index('index')");
+ transaction.oncomplete = onTransactionComplete;
+}
+
+function onTransactionComplete(evt)
+{
+ preamble(evt);
+ debug("In multiprocess mode, 'complete' event may be dispatched before\n" +
+ "the 'success' arrives with updated metadata. Ensure the new metadata\n" +
+ "is still used for transactions.");
+ evalAndLog("store = db.transaction('store').objectStore('store')");
+ shouldNotThrow("index = store.index('index')");
+}
+
+function onOpenSuccess(evt)
+{
+ preamble(evt);
+ evalAndLog("db = event.target.result");
+ evalAndLog("store = db.transaction('store').objectStore('store')");
+ shouldNotThrow("index = store.index('index')");
+ finishJSTest();
+}
+
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
« no previous file with comments | « no previous file | LayoutTests/storage/indexeddb/metadata-race-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698