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