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

Unified Diff: LayoutTests/storage/indexeddb/microtasks.html

Issue 555163005: Deactivate IDBTransactions created within Microtasks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove bogus line, clean up hideous conditional Created 6 years, 3 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
Index: LayoutTests/storage/indexeddb/microtasks.html
diff --git a/LayoutTests/storage/indexeddb/microtasks.html b/LayoutTests/storage/indexeddb/microtasks.html
index fb081715f5b4b950623537218a1c6864a1aa1674..b09c9d2f549b07e86dd0db5cc309340e16bd61a2 100644
--- a/LayoutTests/storage/indexeddb/microtasks.html
+++ b/LayoutTests/storage/indexeddb/microtasks.html
@@ -58,6 +58,30 @@ idb_test(
);
idb_test(
+ 'Transactions created in microtasks resolved by host behavior are deactivated when control returns to the event loop',
+ function(t, db) {
+ db.createObjectStore('store');
+ },
+ function(t, db) {
+ var aesAlgorithmKeyGen = {name: "AES-CBC", length: 128};
+ crypto.subtle.generateKey(aesAlgorithmKeyGen, false, ["encrypt"]).then(t.step_func(function() {
+ var tx = db.transaction('store');
+ var request = tx.objectStore('store').get(0);
+ request.onerror = t.unreached_func('request should not fail');
+ request.onsuccess = t.step_func(function() {
+ assert_true(isTransactionActive(tx, 'store'),
+ 'Transaction should be active during event dispatch');
+ setTimeout(t.step_func(function() {
+ assert_false(isTransactionActive(tx, 'store'),
+ 'Transaction should be inactive once control returns to event loop');
+ t.done();
+ }), 0);
+ });
+ }));
+ }
+);
+
+idb_test(
'Transactions created in microtasks remain active in subsequent microtasks',
function(t, db) {
db.createObjectStore('store');

Powered by Google App Engine
This is Rietveld 408576698