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

Side by Side 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, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1
2
3 function waitAndTest(tests)
4 {
5 window.jsTestIsAsync = true;
6
7 function runNext()
8 {
9 var options = tests.shift();
10 if (!options)
11 return finishJSTest();
12 return runSingleTest(options);
13 }
14
15 function runSingleTest(options)
16 {
17 var ntries = 10;
18 function checkWhenReady()
19 {
20 if (--ntries < 0) {
21 testFailed("Timed out");
22 return finishJSTest();
23 }
24
25 if (!options.ready())
26 return setTimeout(checkWhenReady, 0);
27
28 options.test();
29 return runNext();
30 }
31
32 debug(options.description);
33 if (options.setup)
34 options.setup();
35 checkWhenReady();
36 }
37
38 window.setTimeout(runNext, 0);
39 }
40
41 function createPlaceholder()
42 {
43 var link = document.createElement("link");
44 link.setAttribute("href", "resources/placeholder.html");
45 link.setAttribute("rel", "import");
46 document.head.appendChild(link);
47 return link;
48 }
OLDNEW
« 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