Debian Codegraph @

closure-library/all_tests.html

raw
1 <!DOCTYPE html>
2 <html>
3 <!--
4 Copyright 2009 The Closure Library Authors. All Rights Reserved.
5
6 Use of this source code is governed by the Apache License, Version 2.0.
7 See the COPYING file for details.
8 -->
9 <head>
10 <title>Closure - All JsUnit Tests</title>
11 <script src="closure/goog/base.js"></script>
12 <script src="alltests.js"></script>
13 <script>
14 goog.require('goog.userAgent.product');
15 goog.require('goog.testing.MultiTestRunner');
16 </script>
17 <link rel="stylesheet" href="closure/goog/css/multitestrunner.css" type="text/css">
18 <style>
19 h1 {
20 font: normal x-large arial, helvetica, sans-serif;
21 margin: 0;
22 }
23 p, form {
24 font: normal small sans-serif;
25 margin: 0;
26 }
27 #header {
28 position: absolute;
29 right: 10px;
30 top: 13px;
31 }
32 #footer {
33 margin-top: 8px;
34 }
35 a {
36 text-decoration: none;
37 }
38 a:hover {
39 text-decoration: underline;
40 }
41 .warning {
42 font-size: 14px;
43 font-weight: bold;
44 width: 80%;
45 }
46 </style>
47 </head>
48 <body>
49
50 <script>
51 if (goog.userAgent.product.CHROME &&
52 window.location.toString().indexOf('file:') == 0) {
53 document.write(
54 '<div class="warning">' +
55 'WARNING: Due to Chrome\'s security restrictions ' +
56 'this test will not be able to load files off your local disk ' +
57 'unless you start Chrome with:<br>' +
58 '<code>--allow-file-access-from-files</code></div><br>');
59 }
60 </script>
61
62 <h1>Closure - All JsUnit Tests</h1>
63 <p id="header"></p>
64 <div id="runner"></div>
65 <!-- Use a form so browser persists input values -->
66 <form id="footer" onsubmit="return false">
67 Settings:<br>
68 <input type="checkbox" name="hidepasses" id="hidepasses" checked>
69 <label for="hidepasses">Hide passes</label><br>
70 <input type="checkbox" name="parallel" id="parallel" checked>
71 <label for="parallel">Run in parallel</label>
72 <small>(timing stats not available if enabled)</small><br>
73 <input type="text" name="filter" id="filter" value="">
74 <label for="filter">Run only tests for path</label>
75 </form>
76 <script>
77 var hidePassesInput = document.getElementById('hidepasses');
78 var parallelInput = document.getElementById('parallel');
79 var filterInput = document.getElementById('filter');
80
81 function setFilterFunction() {
82 var matchValue = filterInput.value || '';
83 testRunner.setFilterFunction(function(testPath) {
84 return testPath.indexOf(matchValue) > -1;
85 });
86 }
87
88 // Create a test runner and render it.
89 var testRunner = new goog.testing.MultiTestRunner()
90 .setName(document.title)
91 .setBasePath('./')
92 .setPoolSize(parallelInput.checked ? 8 : 1)
93 .setStatsBucketSizes(5, 500)
94 .setHidePasses(hidePassesInput.checked)
95 //.setVerbosePasses(true)
96 .addTests(_allTests);
97 testRunner.render(document.getElementById('runner'));
98
99 goog.events.listen(hidePassesInput, 'click', function(e) {
100 testRunner.setHidePasses(e.target.checked);
101 });
102
103 goog.events.listen(parallelInput, 'click', function(e) {
104 testRunner.setPoolSize(e.target.checked ? 8 : 1);
105 });
106
107 goog.events.listen(filterInput, 'keyup', setFilterFunction);
108 setFilterFunction();
109 </script>
110 </body>
111 </html>