4 Copyright (c) 2012 The Chromium Authors. All rights reserved.
5 Use of this source code is governed by a BSD-style license that can be
6 found in the LICENSE file.
9 <title>All Tests
</title>
12 'analysis_view_test.html',
13 'base/bbox2_test.html',
14 'base/color_test.html',
15 'base/gl_matrix_test.html',
16 'base/range_test.html',
17 'lthi_view_test.html',
18 'layer_tree_impl_view_test.html',
19 'layer_impl_view_test.html',
21 'model_view_test.html',
22 'quad_view_test.html',
23 'quad_view_viewport_test.html',
24 'tile_view_test.html',
25 'tree_quad_view_test.html',
26 'ui/list_and_associated_view_test.html',
27 'ui/list_view_test.html',
32 font-family: sans-serif;
36 <script src=
"base.js"></script>
38 base
.require('base.unittest');
44 <div class=
"unittest">Interactive tests:
<a href=
"interactive_tests.html" class=
"unittest-error-link">Run manually
</a></div>
48 function runTest(runner
, testCaseEl
, test
) {
49 testCaseEl
.status
= 'RUNNING'
51 var iframe
= document
.createElement('iframe');
53 iframe
.style
.position
= 'fixed';
54 iframe
.style
.visibility
= 'hidden';
55 document
.body
.appendChild(iframe
);
56 iframe
.contentWindow
.addEventListener('error', function(msg
, url
, lineNumber
) {
57 if (iframe
.contentWindow
.G_testRunner
)
60 if (iframe
.contentWindow
.errorsCaughtByTestHarness
)
63 iframe
.contentWindow
.errorsCaughtByTestHarness
= [
64 {msg
: msg
, url
: url
, lineNumber
: lineNumber
}];
68 function checkForDone() {
69 if (!iframe
.contentWindow
) {
70 setTimeout(checkForDone
, 100);
74 if (iframe
.contentWindow
.errorsCaughtByTestHarness
&&
75 iframe
.contentWindow
.errorsCaughtByTestHarness
.length
) {
76 testCaseEl
.status
= 'FAILED'
80 if (!iframe
.contentWindow
.G_testRunner
) {
81 setTimeout(checkForDone
, 100);
85 var runner
= iframe
.contentWindow
.G_testRunner
;
87 setTimeout(checkForDone
, 100);
91 var stats
= runner
.computeResultStats();
92 if (stats
.numTestsRun
&& !stats
.numTestsWithErrors
)
93 testCaseEl
.status
= 'PASSED'
95 testCaseEl
.status
= 'FAILED'
97 setTimeout(checkForDone
, 0);
101 var resultsEl
= document
.createElement('div');
102 resultsEl
.className
= 'unittest';
103 document
.body
.appendChild(resultsEl
);
108 addFailedTest: function() {
111 addPassedTest: function() {
116 for (var i
= 0; i
< tests
.length
; i
++) {
118 var testCaseEl
= base
.unittest
.createTestCaseDiv_(tests
[i
], tests
[i
], true);
119 resultsEl
.appendChild(testCaseEl
);
120 runTest(runner
, testCaseEl
, tests
[i
]);
126 document
.addEventListener('DOMContentLoaded', run
);