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

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: 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 <link rel="help" href="http://crbug.com/705837">
7 <script src="/resources/testharness.js"></script>
8 <script src="/resources/testharnessreport.js"></script>
9 <script src="support-promises.js"></script>
10 <script>
11 'use strict';
12
13 for (let cursorCount of [2, 10, 100, 1000, 10000]) {
14 promise_test(testCase => {
dmurph 2017/03/29 23:36:34 Do we really need this many cursors to get it to w
pwnall 2017/03/29 23:49:07 Clusterfuzz used 10k (2x 5k). Also, this test inte
15 return createDatabase(testCase, (database, transaction) => {
16 const store = database.createObjectStore('cache', { keyPath: 'key' });
17 store.put({ key: '42' });
18
19 const promises = [];
20
21 for (let j = 0; j < 2; j += 1) {
22 const promise = new Promise((resolve, reject) => {
23 let request = null;
24 for (let i = 0; i < cursorCount / 2; i += 1) {
25 request = store.openCursor();
26 }
27
28 let continued = false;
29 request.onsuccess = testCase.step_func(() => {
30 const cursor = request.result;
31
32 if (!continued) {
33 assert_equals(cursor.key, '42');
34 assert_equals(cursor.value.key, '42');
35 continued = true;
36 cursor.continue();
37 } else {
38 assert_equals(cusor, null);
39 resolve();
40 }
41 });
42 request.onerror = () => reject(request.error);
43 });
44 promises.push(promise);
45 }
46 return Promise.all(promises);
47 }).then(database => {
48 database.close();
49 });
50 }, `${cursorCount} cursors`);
51 }
52
53 </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