| 24 | } |
| 25 | var namespace = ""; |
| 26 | function testCM(name, run, opts, expectedFail) { |
| 27 | return test(namespace + name, function() { |
| 28 | var place = document.getElementById("testground"), cm = window.cm = CodeMirror(place, opts); |
| 29 | var successful = false; |
| 30 | try { |
| 31 | run(cm); |
| 32 | successful = true; |
| 33 | } finally { |
| 34 | if (!successful || verbose) { |
| 35 | place.style.visibility = "visible"; |
| 36 | } else { |
| 37 | place.removeChild(cm.getWrapperElement()); |
| 38 | } |
| 39 | } |
| 40 | }, expectedFail); |
| 41 | } |
| 42 | |
| 43 | function runTests(callback) { |
| 44 | var totalTime = 0; |