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

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

Issue 2398313002: WebSQL: Add missing getExecutionContext() null check (Closed)
Patch Set: Use newfangled remove() method to simplify repro 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 | « no previous file | third_party/WebKit/LayoutTests/storage/websql/database-removed-context-crash-expected.txt » ('j') | 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 <title>Database from removed execution context</title>
3 <script>
4 if (window.testRunner) {
5 testRunner.dumpAsText();
6 testRunner.waitUntilDone();
7 }
8
9 var script = `
10 var db = openDatabase('' + Date.now() + Math.random(), '1', 'db', 1024);
11 frameElement.remove();
12 `;
13
14 var cases = [
15 'db.transaction(() => {});',
16 'db.readTransaction(() => {});',
17 'db.changeVersion(1, 2);'
18 ];
19
20 window.addEventListener('DOMContentLoaded', e => {
21 function nextCase() {
22 if (!cases.length) {
23 if (window.testRunner)
24 testRunner.notifyDone();
25 return;
26 }
27
28 var srcdoc = '<script>' + script + cases.shift() + '<\/script>';
29 var iframe = document.createElement('iframe');
30 document.body.appendChild(iframe);
31 iframe.srcdoc = srcdoc;
32 waitUntil(() => iframe.parentNode === null, nextCase);
33 }
34
35 nextCase();
36 });
37
38 // Poll (10ms) until testFunc returns true, then execute callback().
39 function waitUntil(testFunc, callback) {
40 setTimeout(() => {
41 if (testFunc())
42 callback();
43 else
44 waitUntil(testFunc, callback);
45 }, 10);
46 }
47 </script>
48 <body>
49 If it doesn't crash, this test has passed.
50 </body>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/storage/websql/database-removed-context-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698