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

Unified Diff: LayoutTests/storage/indexeddb/resources/transaction-coordination-ro-waits-for-rw.js

Issue 745553002: IDB: Layout test showing ro transactions wait for rw transactions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove hyphen from -expected.txt Created 6 years, 1 month 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/transaction-coordination-ro-waits-for-rw.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/storage/indexeddb/resources/transaction-coordination-ro-waits-for-rw.js
diff --git a/LayoutTests/storage/indexeddb/resources/transaction-coordination-ro-waits-for-rw.js b/LayoutTests/storage/indexeddb/resources/transaction-coordination-ro-waits-for-rw.js
new file mode 100644
index 0000000000000000000000000000000000000000..afcaf61b902f345b3a24bc358a4f7a7be470b111
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/resources/transaction-coordination-ro-waits-for-rw.js
@@ -0,0 +1,38 @@
+if (this.importScripts) {
+ importScripts('../../../resources/js-test.js');
+ importScripts('shared.js');
+}
+
+description("readonly transaction should see the result of a previous readwrite transaction");
+
+indexedDBTest(prepareDatabase, runTransactions);
+
+function prepareDatabase(evt)
+{
+ preamble(evt);
+ evalAndLog("db = event.target.result");
+ evalAndLog("store = db.createObjectStore('store')");
+ evalAndLog("store.put('original value', 'key')");
+}
+
+function runTransactions(evt)
+{
+ preamble(evt);
+ evalAndLog("db = event.target.result");
+ evalAndLog("transaction1 = db.transaction('store', 'readwrite')");
+ transaction1.onabort = unexpectedAbortCallback;
+ evalAndLog("transaction2 = db.transaction('store', 'readonly')");
+ transaction2.onabort = unexpectedAbortCallback;
+
+ evalAndLog("request = transaction1.objectStore('store').put('new value', 'key')");
+ request.onerror = unexpectedErrorCallback;
+
+ evalAndLog("request2 = transaction2.objectStore('store').get('key')");
+ request2.onerror = unexpectedErrorCallback;
+ request2.onsuccess = function checkResult(evt) {
+ preamble(evt);
+ shouldBeEqualToString('request2.result', 'new value');
+ db.close();
+ finishJSTest();
+ };
+}
« no previous file with comments | « no previous file | LayoutTests/storage/indexeddb/transaction-coordination-ro-waits-for-rw.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698