Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/external/wpt/IndexedDB/support.js |
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/support.js b/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/support.js |
| index 63b23e5a73e7af363dd50a9cf407ffb04bc53f8d..20c26f00c26438cdd337574d5cc8b69c7bbf83cb 100644 |
| --- a/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/support.js |
| +++ b/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/support.js |
| @@ -143,3 +143,23 @@ function expect(t, expected) { |
| } |
| }; |
| } |
| + |
| +// Checks to see if the passed transaction is active (by |
| +// making |
| +// requests against the named store). Returns a function to |
| +// to let the transaction finish. |
|
pwnall
2017/03/04 00:27:33
double "to", and I don't think this comment is acc
jsbell
2017/03/06 18:25:02
Thanks. And whoah, not sure what happened there.
|
| +function is_transaction_active(tx, store_name) { |
| + try { |
| + const request = tx.objectStore(store_name).get(0); |
| + request.onerror = e => { |
| + e.preventDefault(); |
| + e.stopPropagation(); |
| + }; |
| + return true; |
| + } catch (ex) { |
| + assert_equals(ex.name, 'TransactionInactiveError', |
| + 'Active check should either not throw, or throw ' + |
|
pwnall
2017/03/04 00:27:33
"not throw anything" would make the structure para
jsbell
2017/03/06 18:25:02
Done.
|
| + 'TransactionInactiveError'); |
| + return false; |
| + } |
| +} |