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

Unified Diff: LayoutTests/fast/html/imports/resources/import-helpers.js

Issue 15856002: First step of HTMLImports (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed Mac build Created 7 years, 7 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: 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;
+}
« no previous file with comments | « LayoutTests/fast/html/imports/resources/hello.html ('k') | LayoutTests/fast/html/imports/resources/placeholder.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698