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

Side by Side 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, 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype html>
2 <meta charset="utf-8">
3 <meta name="timeout" content="long">
4 <title>IndexedDB: Parallel iteration of cursors in upgradeneeded</title>
5 <link rel="author" href="pwnall@chromium.org" title="Victor Costan">
6 <script src="/resources/testharness.js"></script>
7 <script src="/resources/testharnessreport.js"></script>
8 <script src="support-promises.js"></script>
9 <script>
10 'use strict';
11
12 for (let cursorCount of [2, 10, 100, 1000, 10000]) {
13 promise_test(testCase => {
14 return createDatabase(testCase, (database, transaction) => {
15 const store = database.createObjectStore('cache', { keyPath: 'key' });
16 store.put({ key: '42' });
17
18 const promises = [];
19
20 for (let j = 0; j < 2; j += 1) {
21 const promise = new Promise((resolve, reject) => {
22 let request = null;
23 for (let i = 0; i < cursorCount / 2; i += 1) {
24 request = store.openCursor();
25 }
26
27 let continued = false;
28 request.onsuccess = testCase.step_func(() => {
29 const cursor = request.result;
30
31 if (!continued) {
32 assert_equals(cursor.key, '42');
33 assert_equals(cursor.value.key, '42');
34 continued = true;
35 cursor.continue();
36 } else {
37 assert_equals(cursor, null);
38 resolve();
39 }
40 });
41 request.onerror = () => reject(request.error);
42 });
43 promises.push(promise);
44 }
45 return Promise.all(promises);
46 }).then(database => {
47 database.close();
48 });
49 }, `${cursorCount} cursors`);
50 }
51
52 </script>
OLDNEW
« 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