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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/IndexedDB/parallel-cursors-upgrade.html

Issue 2779273004: Test for IndexedDB crashing bug found by clusterfuzz. (Closed)
Patch Set: Feedback. Created 3 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/external/wpt/IndexedDB/parallel-cursors-upgrade.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/parallel-cursors-upgrade.html b/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/parallel-cursors-upgrade.html
new file mode 100644
index 0000000000000000000000000000000000000000..ef5a617a459e3b2929637cf92163ed1b3f91dacc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/parallel-cursors-upgrade.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<meta charset="utf-8">
+<meta name="timeout" content="long">
+<title>IndexedDB: Parallel iteration of cursors in upgradeneeded</title>
+<link rel="author" href="pwnall@chromium.org" title="Victor Costan">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support-promises.js"></script>
+<script>
+'use strict';
+
+for (let cursorCount of [2, 10, 100, 1000, 10000]) {
+ promise_test(testCase => {
+ return createDatabase(testCase, (database, transaction) => {
+ const store = database.createObjectStore('cache', { keyPath: 'key' });
+ store.put({ key: '42' });
+
+ const promises = [];
+
+ for (let j = 0; j < 2; j += 1) {
+ const promise = new Promise((resolve, reject) => {
+ let request = null;
+ for (let i = 0; i < cursorCount / 2; i += 1) {
+ request = store.openCursor();
+ }
+
+ let continued = false;
+ request.onsuccess = testCase.step_func(() => {
+ const cursor = request.result;
+
+ if (!continued) {
+ assert_equals(cursor.key, '42');
+ assert_equals(cursor.value.key, '42');
+ continued = true;
+ cursor.continue();
+ } else {
+ assert_equals(cursor, null);
+ resolve();
+ }
+ });
+ request.onerror = () => reject(request.error);
+ });
+ promises.push(promise);
+ }
+ return Promise.all(promises);
+ }).then(database => {
+ database.close();
+ });
+ }, `${cursorCount} cursors`);
+}
+
+</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698