<!DOCTYPE html>
<html>
<!--
Copyright (c) 2012 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<head>
<title>All Tracing Tests</title>
<script>
tests = [
'category_filter_dialog_test.html',
'filter_test.html',
'find_control_test.html',
'overlay_test.html',
'profiling_view_test.html',
'range_test.html',
'selection_test.html',
'settings_test.html',
'timeline_analysis_view_test.html',
'timeline_test.html',
'timeline_view_test.html',
'timeline_viewport_test.html',
'ui_test.html',
'unittest_test.html',
'model_test.html',
'model/async_slice_group_test.html',
'model/counter_test.html',
'model/cpu_test.html',
'model/process_base_test.html',
'model/process_test.html',
'model/slice_group_test.html',
'model/thread_test.html',
'importer/linux_perf_importer_test.html',
'importer/linux_perf/android_parser_test.html',
'importer/linux_perf/bus_parser_test.html',
'importer/linux_perf/clock_parser_test.html',
'importer/linux_perf/cpufreq_parser_test.html',
'importer/linux_perf/disk_parser_test.html',
'importer/linux_perf/drm_parser_test.html',
'importer/linux_perf/exynos_parser_test.html',
'importer/linux_perf/gesture_parser_test.html',
'importer/linux_perf/i915_parser_test.html',
'importer/linux_perf/kfunc_parser_test.html',
'importer/linux_perf/mali_parser_test.html',
'importer/linux_perf/power_parser_test.html',
'importer/linux_perf/sched_parser_test.html',
'importer/linux_perf/workqueue_parser_test.html',
'importer/timeline_stream_importer_test.html',
'importer/trace_event_importer_test.html',
'importer/v8_log_importer_test.html',
'tracks/async_slice_group_track_test.html',
'tracks/cpu_track_test.html',
'tracks/counter_track_test.html',
'tracks/slice_group_track_test.html',
'tracks/slice_track_test.html',
'tracks/thread_track_test.html',
'tracks/ruler_track_test.html',
'analysis/counter_selection_analysis_test.html',
'analysis/selection_analysis_test.html',
'analysis/slice_selection_analysis_test.html',
'analysis/slice_group_selection_analysis_test.html',
'analysis/single_counter_selection_analysis_test.html',
'analysis/single_slice_selection_analysis_test.html',
];
</script>
<style>
h1 {
font-family: sans-serif;
font-size: 18pt;
}
</style>
<script src="base.js"></script>
<script>
base.require('unittest');
</script>
</head>
<body>
<h1>Trace-Viewer Tests</h3>
<div class="unittest">Interactive tests: <a href="interactive_tests.html" class="unittest-error-link">Run manually</a></div>
<br>
<script>
function runTest(runner, testCaseEl, test) {
testCaseEl.status = 'RUNNING'
var iframe = document.createElement('iframe');
iframe.src = test;
iframe.style.position = 'fixed';
iframe.style.visibility = 'hidden';
document.body.appendChild(iframe);
iframe.contentWindow.addEventListener('error', function(msg, url, lineNumber) {
if (iframe.contentWindow.G_testRunner)
return false;
if (iframe.contentWindow.errorsCaughtByTestHarness)
return false;
iframe.contentWindow.errorsCaughtByTestHarness = [
{msg: msg, url: url, lineNumber: lineNumber}];
return false;
});
function checkForDone() {
if (!iframe.contentWindow) {
setTimeout(checkForDone, 100);
return;
}
if (iframe.contentWindow.errorsCaughtByTestHarness &&
iframe.contentWindow.errorsCaughtByTestHarness.length) {
testCaseEl.status = 'FAILED'
return;
}
if (!iframe.contentWindow.G_testRunner) {
setTimeout(checkForDone, 100);
return;
}
var runner = iframe.contentWindow.G_testRunner;
if (!runner.done) {
setTimeout(checkForDone, 100);
return;
}
var stats = runner.computeResultStats();
if (stats.numTestsRun && !stats.numTestsWithErrors)
testCaseEl.status = 'PASSED'
else
testCaseEl.status = 'FAILED'
}
setTimeout(checkForDone, 0);
}
function run() {
var resultsEl = document.createElement('div');
resultsEl.className = 'unittest';
document.body.appendChild(resultsEl);
var numPassed = 0;
var numFailures = 0;
var runner = {
addFailedTest: function() {
numFailures++;
},
addPassedTest: function() {
numPassed++;
}
};
function begin() {
for (var i = 0; i < tests.length; i++) {
(function() {
var testCaseEl = unittest.createTestCaseDiv_(tests[i], tests[i], true);
resultsEl.appendChild(testCaseEl);
runTest(runner, testCaseEl, tests[i]);
})();
}
}
begin();
}
document.addEventListener('DOMContentLoaded', run);
</script>
</body>
</html>