4 // Alex Russell <slightlyoff@chromium.org>
5 // Use of this source code is governed by
6 // http://www.apache.org/licenses/LICENSE-2.0
11 <title>Promise Tests</title>
12 <meta charset="utf-8">
13 <script src="../third_party/doh/runner_async.js"></script>
15 this.runningUnderTest = true;
17 var append = function(n, h) { (h||document.body).appendChild(n); return n; };
18 var t = function(text) { return document.createTextNode(text); };
19 var el = function(type, html, text) {
20 var node = document.createElement(type);
21 if (html) { node.innerHTML = html; }
22 if (text) { node.appendChild(t(text)); }
26 var domLog = function() {
27 var al = arguments.length;
28 var pre = append(el("pre"));
29 for(var x = 0; x < al; x++) {
30 append(t(arguments[x]), pre);
37 doh._print = function(s) { printLog.push(s); }
38 doh._report = (function(r) {
41 append(el("pre", printLog.join("\n")));
46 <script src="../src/Promise.js"></script>
47 <script src="Promise-tests.js"></script>
48 <script>doh.run();</script>
51 <h1>DOM Promise Polyfill Tests</h1>