Skip to content

Commit

Permalink
Add progress indicator div to test page
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Jul 7, 2017
1 parent 8ac3488 commit 5a0facb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test_perf/test_page.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
<meta charset="UTF-8">
</head>
<body>
<div id="progress"></div>
<pre id="output">

</pre>
<script>
var __total_done = 0;
var __total_tests = 0;
__karma__ = {
start: undefined,
result: function(arg) {
__total_done++;
document.getElementById('progress').innerText = 'Progress: ' + __total_done + ' / ' + __total_tests;
if (!arg.success) {
document.getElementById('output').innerText += "\nFAILED: " +
arg.suite[0] + " " + arg.description;
Expand All @@ -20,7 +24,9 @@
}
},
info: function(arg) {
document.getElementById('output').innerText += "\nTotal tests: " + arg.total;
__total_tests = arg.total;
document.getElementById('progress').innerText = 'Progress: ' + __total_done + ' / ' + __total_tests;
document.getElementById('output').innerText += "\nTotal tests: " + arg.total + "\nRunning...";
},
complete: function() {
document.getElementById('output').innerText += "\nDone";
Expand All @@ -29,7 +35,7 @@

<!-- INCLUDE SOURCE PART -->

document.getElementById('output').innerText = "Started...";
document.getElementById('output').innerText = "Starting...";
setTimeout(function() {
__karma__.start();
}, 0);
Expand Down

0 comments on commit 5a0facb

Please sign in to comment.