Upstream version 9.37.197.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / third_party / tvcm / third_party / Promises / polyfill / tests / test.html
1 <!DOCTYPE html>
2 <!--
3 // Copyright (C) 2013:
4 //    Alex Russell <slightlyoff@chromium.org>
5 // Use of this source code is governed by
6 //    http://www.apache.org/licenses/LICENSE-2.0
7 -->
8
9 <html>
10   <head>
11     <title>Promise Tests</title>
12     <meta charset="utf-8">
13     <script src="../third_party/doh/runner_async.js"></script>
14     <script>
15       this.runningUnderTest = true;
16
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)); }
23         return node;
24       };
25
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);
31           append(t("\n"), pre);
32         }
33       };
34
35       doh.squelch = false;
36       var printLog = [];
37       doh._print = function(s) { printLog.push(s); }
38       doh._report = (function(r) {
39         return function() {
40           r.call(doh);
41           append(el("pre", printLog.join("\n")));
42           printLog.length = 0;
43         }
44       })(doh._report);
45     </script>
46     <script src="../src/Promise.js"></script>
47     <script src="Promise-tests.js"></script>
48     <script>doh.run();</script>
49   </head>
50   <body>
51     <h1>DOM Promise Polyfill Tests</h1>
52   </body>
53 </html>