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

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

Issue 2375733003: Add missing null check in Database::getSecurityOrigin() (Closed)
Patch Set: Created 4 years, 3 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 | third_party/WebKit/LayoutTests/storage/websql/transaction-removed-context-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/storage/websql/transaction-removed-context-crash.html
diff --git a/third_party/WebKit/LayoutTests/storage/websql/transaction-removed-context-crash.html b/third_party/WebKit/LayoutTests/storage/websql/transaction-removed-context-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..b2c36f075b7f7cc99274c57f7ebaf546769e2e05
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/storage/websql/transaction-removed-context-crash.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<title>Transaction from removed execution context</title>
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+var script = `
+var db = openDatabase('db' + Math.random() + Date.now(), '1.0', 'test database', 2*1024);
+db.transaction(tx => {
+ tx.executeSql('DROP TABLE IF EXISTS TestTable');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS TestTable (id unique,text)');
+ tx.executeSql('DELETE FROM TestTable WHERE id=?', [1]);
+ frameElement.parentNode.removeChild(frameElement);
+});
+`;
+
+window.addEventListener('DOMContentLoaded', e => {
+ var blob = new Blob(['<script>' + script + '<\/script>'], {'type': 'text/html'});
+ var iframe = document.createElement('iframe');
+ document.body.appendChild(iframe);
+ iframe.src = URL.createObjectURL(blob);
+ if (window.testRunner)
+ window.setTimeout(() => { testRunner.notifyDone() }, 250);
+});
+</script>
+<body>
+If it doesn't crash, this test has passed.
+</body>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/storage/websql/transaction-removed-context-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698