index.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Bootstrap Plugin Test Suite</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <!-- jQuery -->
  8. <script src="vendor/jquery.min.js"></script>
  9. <script>
  10. // Disable jQuery event aliases to ensure we don't accidentally use any of them
  11. (function () {
  12. var eventAliases = [
  13. 'blur',
  14. 'focus',
  15. 'focusin',
  16. 'focusout',
  17. 'load',
  18. 'resize',
  19. 'scroll',
  20. 'unload',
  21. 'click',
  22. 'dblclick',
  23. 'mousedown',
  24. 'mouseup',
  25. 'mousemove',
  26. 'mouseover',
  27. 'mouseout',
  28. 'mouseenter',
  29. 'mouseleave',
  30. 'change',
  31. 'select',
  32. 'submit',
  33. 'keydown',
  34. 'keypress',
  35. 'keyup',
  36. 'error',
  37. 'contextmenu',
  38. 'hover',
  39. 'bind',
  40. 'unbind',
  41. 'delegate',
  42. 'undelegate'
  43. ]
  44. for (var i = 0; i < eventAliases.length; i++) {
  45. $.fn[eventAliases[i]] = undefined
  46. }
  47. })()
  48. </script>
  49. <!-- QUnit -->
  50. <link rel="stylesheet" href="vendor/qunit.css" media="screen">
  51. <script src="vendor/qunit.js"></script>
  52. <script>
  53. // See https://github.com/axemclion/grunt-saucelabs#test-result-details-with-qunit
  54. var log = []
  55. // Require assert.expect in each test.
  56. QUnit.config.requireExpects = true
  57. QUnit.done(function (testResults) {
  58. var tests = []
  59. for (var i = 0, len = log.length; i < len; i++) {
  60. var details = log[i]
  61. tests.push({
  62. name: details.name,
  63. result: details.result,
  64. expected: details.expected,
  65. actual: details.actual,
  66. source: details.source
  67. })
  68. }
  69. testResults.tests = tests
  70. window.global_test_results = testResults
  71. })
  72. QUnit.testStart(function (testDetails) {
  73. $(window).scrollTop(0)
  74. QUnit.log(function (details) {
  75. if (!details.result) {
  76. details.name = testDetails.name
  77. log.push(details)
  78. }
  79. })
  80. })
  81. // Cleanup
  82. QUnit.testDone(function () {
  83. $('#qunit-fixture').empty()
  84. $('#modal-test, .modal-backdrop').remove()
  85. })
  86. // Display fixture on-screen on iOS to avoid false positives
  87. if (/iPhone|iPad|iPod/.test(navigator.userAgent)) {
  88. QUnit.begin(function() {
  89. $('#qunit-fixture').css({ top: 0, left: 0 })
  90. })
  91. QUnit.done(function () {
  92. $('#qunit-fixture').css({ top: '', left: '' })
  93. })
  94. }
  95. // Disable deprecated global QUnit method aliases in preparation for QUnit v2
  96. (function () {
  97. var methodNames = [
  98. 'async',
  99. 'asyncTest',
  100. 'deepEqual',
  101. 'equal',
  102. 'expect',
  103. 'module',
  104. 'notDeepEqual',
  105. 'notEqual',
  106. 'notPropEqual',
  107. 'notStrictEqual',
  108. 'ok',
  109. 'propEqual',
  110. 'push',
  111. 'start',
  112. 'stop',
  113. 'strictEqual',
  114. 'test',
  115. 'throws'
  116. ];
  117. for (var i = 0; i < methodNames.length; i++) {
  118. var methodName = methodNames[i];
  119. window[methodName] = undefined;
  120. }
  121. })();
  122. </script>
  123. <!-- Plugin sources -->
  124. <script>$.support.transition = false</script>
  125. <script src="../../js/alert.js"></script>
  126. <script src="../../js/button.js"></script>
  127. <script src="../../js/carousel.js"></script>
  128. <script src="../../js/collapse.js"></script>
  129. <script src="../../js/dropdown.js"></script>
  130. <script src="../../js/modal.js"></script>
  131. <script src="../../js/scrollspy.js"></script>
  132. <script src="../../js/tab.js"></script>
  133. <script src="../../js/tooltip.js"></script>
  134. <script src="../../js/popover.js"></script>
  135. <script src="../../js/affix.js"></script>
  136. <!-- Unit tests -->
  137. <script src="unit/alert.js"></script>
  138. <script src="unit/button.js"></script>
  139. <script src="unit/carousel.js"></script>
  140. <script src="unit/collapse.js"></script>
  141. <script src="unit/dropdown.js"></script>
  142. <script src="unit/modal.js"></script>
  143. <script src="unit/scrollspy.js"></script>
  144. <script src="unit/tab.js"></script>
  145. <script src="unit/tooltip.js"></script>
  146. <script src="unit/popover.js"></script>
  147. <script src="unit/affix.js"></script>
  148. </head>
  149. <body>
  150. <div id="qunit-container">
  151. <div id="qunit"></div>
  152. <div id="qunit-fixture"></div>
  153. </div>
  154. </body>
  155. </html>