| Index: LayoutTests/fast/html/imports/resources/import-helpers.js
|
| diff --git a/LayoutTests/fast/html/imports/resources/import-helpers.js b/LayoutTests/fast/html/imports/resources/import-helpers.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e7dce60cb1fc4df9eef3940b3f80fc909e39e31d
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/html/imports/resources/import-helpers.js
|
| @@ -0,0 +1,48 @@
|
| +
|
| +
|
| +function waitAndTest(tests)
|
| +{
|
| + window.jsTestIsAsync = true;
|
| +
|
| + function runNext()
|
| + {
|
| + var options = tests.shift();
|
| + if (!options)
|
| + return finishJSTest();
|
| + return runSingleTest(options);
|
| + }
|
| +
|
| + function runSingleTest(options)
|
| + {
|
| + var ntries = 10;
|
| + function checkWhenReady()
|
| + {
|
| + if (--ntries < 0) {
|
| + testFailed("Timed out");
|
| + return finishJSTest();
|
| + }
|
| +
|
| + if (!options.ready())
|
| + return setTimeout(checkWhenReady, 0);
|
| +
|
| + options.test();
|
| + return runNext();
|
| + }
|
| +
|
| + debug(options.description);
|
| + if (options.setup)
|
| + options.setup();
|
| + checkWhenReady();
|
| + }
|
| +
|
| + window.setTimeout(runNext, 0);
|
| +}
|
| +
|
| +function createPlaceholder()
|
| +{
|
| + var link = document.createElement("link");
|
| + link.setAttribute("href", "resources/placeholder.html");
|
| + link.setAttribute("rel", "import");
|
| + document.head.appendChild(link);
|
| + return link;
|
| +}
|
|
|