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

Unified Diff: third_party/WebKit/LayoutTests/storage/websql/transaction-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 side-by-side diff with in-line comments
Download patch
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
index 425b665a490d7345a432b96b1aed2cf6dbcf7c79..676ef5093c023ffea082d1a036ca251a9a64b3fc 100644
--- a/third_party/WebKit/LayoutTests/storage/websql/transaction-removed-context-crash.html
+++ b/third_party/WebKit/LayoutTests/storage/websql/transaction-removed-context-crash.html
@@ -2,8 +2,8 @@
<title>Transaction from removed execution context</title>
<script>
if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
}
var script = `
@@ -12,31 +12,29 @@ 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);
+ frameElement.remove();
});
`;
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) {
- waitUntil(
- () => iframe.parentNode === null,
- () => testRunner.notifyDone()
- );
- }
+ var srcdoc = '<script>' + script + '<\/script>';
+ var iframe = document.createElement('iframe');
+ document.body.appendChild(iframe);
+ iframe.srcdoc = srcdoc;
+ waitUntil(
+ () => iframe.parentNode === null,
+ () => window.testRunner && testRunner.notifyDone()
+ );
});
// Poll (10ms) until testFunc returns true, then execute callback().
function waitUntil(testFunc, callback) {
- setTimeout(() => {
- if (testFunc())
- callback();
- else
- waitUntil(testFunc, callback);
- }, 10);
+ setTimeout(() => {
+ if (testFunc())
+ callback();
+ else
+ waitUntil(testFunc, callback);
+ }, 10);
}
</script>
<body>

Powered by Google App Engine
This is Rietveld 408576698