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

Unified 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, 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 | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | 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
index b2c36f075b7f7cc99274c57f7ebaf546769e2e05..425b665a490d7345a432b96b1aed2cf6dbcf7c79 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
@@ -17,13 +17,27 @@ db.transaction(tx => {
`;
window.addEventListener('DOMContentLoaded', e => {
- var blob = new Blob(['<script>' + script + '<\/script>'], {'type': 'text/html'});
+ 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);
+ if (window.testRunner) {
+ waitUntil(
+ () => iframe.parentNode === null,
+ () => testRunner.notifyDone()
+ );
+ }
});
+
+// Poll (10ms) until testFunc returns true, then execute callback().
+function waitUntil(testFunc, callback) {
+ setTimeout(() => {
+ if (testFunc())
+ callback();
+ else
+ waitUntil(testFunc, callback);
+ }, 10);
+}
</script>
<body>
If it doesn't crash, this test has passed.
« 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