| 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.
|
|
|