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

Side by Side Diff: third_party/WebKit/LayoutTests/storage/websql/transaction-removed-context-crash.html

Issue 2384563002: Deflake storage/websql/transaction-removed-context-crash.html (Closed)
Patch Set: Created 4 years, 2 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 | « third_party/WebKit/LayoutTests/TestExpectations ('k') | 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Transaction from removed execution context</title> 2 <title>Transaction from removed execution context</title>
3 <script> 3 <script>
4 if (window.testRunner) { 4 if (window.testRunner) {
5 testRunner.dumpAsText(); 5 testRunner.dumpAsText();
6 testRunner.waitUntilDone(); 6 testRunner.waitUntilDone();
7 } 7 }
8 8
9 var script = ` 9 var script = `
10 var db = openDatabase('db' + Math.random() + Date.now(), '1.0', 'test database', 2*1024); 10 var db = openDatabase('db' + Math.random() + Date.now(), '1.0', 'test database', 2*1024);
11 db.transaction(tx => { 11 db.transaction(tx => {
12 tx.executeSql('DROP TABLE IF EXISTS TestTable'); 12 tx.executeSql('DROP TABLE IF EXISTS TestTable');
13 tx.executeSql('CREATE TABLE IF NOT EXISTS TestTable (id unique,text)'); 13 tx.executeSql('CREATE TABLE IF NOT EXISTS TestTable (id unique,text)');
14 tx.executeSql('DELETE FROM TestTable WHERE id=?', [1]); 14 tx.executeSql('DELETE FROM TestTable WHERE id=?', [1]);
15 frameElement.parentNode.removeChild(frameElement); 15 frameElement.parentNode.removeChild(frameElement);
16 }); 16 });
17 `; 17 `;
18 18
19 window.addEventListener('DOMContentLoaded', e => { 19 window.addEventListener('DOMContentLoaded', e => {
20 var blob = new Blob(['<script>' + script + '<\/script>'], {'type': 'text/ht ml'}); 20 var blob = new Blob(['<script>' + script + '<\/script>'], {'type': 'text/htm l'});
21 var iframe = document.createElement('iframe'); 21 var iframe = document.createElement('iframe');
22 document.body.appendChild(iframe); 22 document.body.appendChild(iframe);
23 iframe.src = URL.createObjectURL(blob); 23 iframe.src = URL.createObjectURL(blob);
24 if (window.testRunner) 24 if (window.testRunner) {
25 window.setTimeout(() => { testRunner.notifyDone() }, 250); 25 waitUntil(
26 () => iframe.parentNode === null,
27 () => testRunner.notifyDone()
28 );
29 }
26 }); 30 });
31
32 // Poll (10ms) until testFunc returns true, then execute callback().
33 function waitUntil(testFunc, callback) {
34 setTimeout(() => {
35 if (testFunc())
36 callback();
37 else
38 waitUntil(testFunc, callback);
39 }, 10);
40 }
27 </script> 41 </script>
28 <body> 42 <body>
29 If it doesn't crash, this test has passed. 43 If it doesn't crash, this test has passed.
30 </body> 44 </body>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698