| OLD | NEW |
| 1 /* | 1 /* |
| 2 * THIS FILE INTENTIONALLY LEFT BLANK | 2 * THIS FILE INTENTIONALLY LEFT BLANK |
| 3 * | 3 * |
| 4 * More specifically, this file is intended for vendors to implement | 4 * More specifically, this file is intended for vendors to implement |
| 5 * code needed to integrate testharness.js tests with their own test systems. | 5 * code needed to integrate testharness.js tests with their own test systems. |
| 6 * | 6 * |
| 7 * Typically such integration will attach callbacks when each test is | 7 * Typically such integration will attach callbacks when each test is |
| 8 * has run, using add_result_callback(callback(test)), or when the whole test fi
le has | 8 * has run, using add_result_callback(callback(test)), or when the whole test fi
le has |
| 9 * completed, using add_completion_callback(callback(tests, harness_status)). | 9 * completed, using add_completion_callback(callback(tests, harness_status)). |
| 10 * | 10 * |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 // Set results element's textContent to the results string | 95 // Set results element's textContent to the results string |
| 96 results.textContent = resultStr; | 96 results.textContent = resultStr; |
| 97 | 97 |
| 98 function done() { | 98 function done() { |
| 99 if (self.testRunner) { | 99 if (self.testRunner) { |
| 100 var logDiv = document.getElementById('log'); | 100 var logDiv = document.getElementById('log'); |
| 101 if ((isCSSWGTest() || isJSTest()) && logDiv) { | 101 if ((isCSSWGTest() || isJSTest()) && logDiv) { |
| 102 // Assume it's a CSSWG style test, and anything other than the l
og div isn't | 102 // Assume it's a CSSWG style test, and anything other than the l
og div isn't |
| 103 // material to the testrunner output, so should be hidden from t
he text dump | 103 // material to the testrunner output, so should be hidden from t
he text dump |
| 104 for (var i = 0; i < document.body.children.length; i++) { | 104 var next = null; |
| 105 document.body.children[i].style.visibility = "hidden"; | 105 for (var child = document.body.firstChild; child; child = next)
{ |
| 106 next = child.nextSibling; |
| 107 if (child.nodeType == Node.ELEMENT_NODE) |
| 108 child.style.visibility = "hidden"; |
| 109 else if (child.nodeType == Node.TEXT_NODE) |
| 110 document.body.removeChild(child); |
| 106 } | 111 } |
| 107 } | 112 } |
| 108 } | 113 } |
| 109 | 114 |
| 110 // Add results element to document. | 115 // Add results element to document. |
| 111 if (!document.body) | 116 if (!document.body) |
| 112 document.documentElement.appendChild(document.createElement("body"))
; | 117 document.documentElement.appendChild(document.createElement("body"))
; |
| 113 document.body.appendChild(results); | 118 document.body.appendChild(results); |
| 114 | 119 |
| 115 if (self.testRunner) | 120 if (self.testRunner) |
| 116 testRunner.notifyDone(); | 121 testRunner.notifyDone(); |
| 117 } | 122 } |
| 118 | 123 |
| 119 if (document.readyState === 'loading') { | 124 if (document.readyState === 'loading') { |
| 120 window.addEventListener('load', done); | 125 window.addEventListener('load', done); |
| 121 } else { | 126 } else { |
| 122 done(); | 127 done(); |
| 123 } | 128 } |
| 124 }); | 129 }); |
| OLD | NEW |