index.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <!doctype html>
  2. <html lang="en">
  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, len = eventAliases.length; i < len; i++) {
  45. var eventAlias = eventAliases[i]
  46. $.fn[eventAlias] = function () {
  47. throw new Error('Using the ".' + eventAlias + '()" method is not allowed, so that Bootstrap can be compatible with custom jQuery builds which exclude the "event aliases" module that defines said method. See https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#js')
  48. }
  49. }
  50. })()
  51. </script>
  52. <!-- QUnit -->
  53. <link rel="stylesheet" href="../../node_modules/qunitjs/qunit/qunit.css" media="screen">
  54. <script src="../../node_modules/qunitjs/qunit/qunit.js"></script>
  55. <script>
  56. // See https://github.com/axemclion/grunt-saucelabs#test-result-details-with-qunit
  57. var log = []
  58. // Require assert.expect in each test
  59. QUnit.config.requireExpects = true
  60. QUnit.done(function (testResults) {
  61. var tests = []
  62. for (var i = 0, len = log.length; i < len; i++) {
  63. var details = log[i]
  64. tests.push({
  65. name: details.name,
  66. result: details.result,
  67. expected: details.expected,
  68. actual: details.actual,
  69. source: details.source
  70. })
  71. }
  72. testResults.tests = tests
  73. window.global_test_results = testResults
  74. })
  75. QUnit.testStart(function (testDetails) {
  76. $(window).scrollTop(0)
  77. QUnit.log(function (details) {
  78. if (!details.result) {
  79. details.name = testDetails.name
  80. log.push(details)
  81. }
  82. })
  83. })
  84. // Cleanup
  85. QUnit.testDone(function () {
  86. $('#qunit-fixture').empty()
  87. $('#modal-test, .modal-backdrop').remove()
  88. })
  89. // Display fixture on-screen on iOS to avoid false positives
  90. if (/iPhone|iPad|iPod/.test(navigator.userAgent)) {
  91. QUnit.begin(function() {
  92. $('#qunit-fixture').css({ top: 0, left: 0 })
  93. })
  94. QUnit.done(function () {
  95. $('#qunit-fixture').css({ top: '', left: '' })
  96. })
  97. }
  98. // Disable deprecated global QUnit method aliases in preparation for QUnit v2
  99. (function () {
  100. var methodNames = [
  101. 'async',
  102. 'asyncTest',
  103. 'deepEqual',
  104. 'equal',
  105. 'expect',
  106. 'module',
  107. 'notDeepEqual',
  108. 'notEqual',
  109. 'notPropEqual',
  110. 'notStrictEqual',
  111. 'ok',
  112. 'propEqual',
  113. 'push',
  114. 'start',
  115. 'stop',
  116. 'strictEqual',
  117. 'test',
  118. 'throws'
  119. ];
  120. for (var i = 0, len = methodNames.length; i < len; i++) {
  121. var methodName = methodNames[i];
  122. window[methodName] = undefined;
  123. }
  124. })();
  125. </script>
  126. <!-- Plugin sources -->
  127. <script src="../../js/alert.js"></script>
  128. <script src="../../js/button.js"></script>
  129. <script src="../../js/carousel.js"></script>
  130. <script src="../../js/collapse.js"></script>
  131. <script src="../../js/dropdown.js"></script>
  132. <script src="../../js/modal.js"></script>
  133. <script src="../../js/scrollspy.js"></script>
  134. <script src="../../js/tab.js"></script>
  135. <script src="../../js/tooltip.js"></script>
  136. <script src="../../js/popover.js"></script>
  137. <script src="../../js/affix.js"></script>
  138. <!-- Unit tests -->
  139. <script src="unit/alert.js"></script>
  140. <script src="unit/button.js"></script>
  141. <script src="unit/carousel.js"></script>
  142. <script src="unit/collapse.js"></script>
  143. <script src="unit/dropdown.js"></script>
  144. <script src="unit/modal.js"></script>
  145. <script src="unit/scrollspy.js"></script>
  146. <script src="unit/tab.js"></script>
  147. <script src="unit/tooltip.js"></script>
  148. <script src="unit/popover.js"></script>
  149. <script src="unit/affix.js"></script>
  150. </head>
  151. <body>
  152. <div id="qunit-container">
  153. <div id="qunit"></div>
  154. <div id="qunit-fixture"></div>
  155. </div>
  156. </body>
  157. </html>