all_tests.html 3.1 KB

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