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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 // Set results element's textContent to the results string | 97 // Set results element's textContent to the results string |
98 results.textContent = resultStr; | 98 results.textContent = resultStr; |
99 | 99 |
100 function done() { | 100 function done() { |
101 if (self.testRunner) { | 101 if (self.testRunner) { |
102 var logDiv = document.getElementById('log'); | 102 var logDiv = document.getElementById('log'); |
103 if ((isCSSWGTest() || isJSTest()) && logDiv) { | 103 if ((isCSSWGTest() || isJSTest()) && logDiv) { |
104 // Assume it's a CSSWG style test, and anything other than the l
og div isn't | 104 // Assume it's a CSSWG style test, and anything other than the l
og div isn't |
105 // material to the testrunner output, so should be hidden from t
he text dump | 105 // material to the testrunner output, so should be hidden from t
he text dump |
106 var next = null; | 106 document.body.textContent = ''; |
107 for (var child = document.body.firstChild; child; child = next)
{ | |
108 next = child.nextSibling; | |
109 if (child.nodeType == Node.ELEMENT_NODE) | |
110 child.style.visibility = "hidden"; | |
111 else if (child.nodeType == Node.TEXT_NODE) | |
112 document.body.removeChild(child); | |
113 } | |
114 } | 107 } |
115 } | 108 } |
116 | 109 |
117 // Add results element to document. | 110 // Add results element to document. |
118 if (!document.body) | 111 if (!document.body) |
119 document.documentElement.appendChild(document.createElement("body"))
; | 112 document.documentElement.appendChild(document.createElement("body"))
; |
120 document.body.appendChild(results); | 113 document.body.appendChild(results); |
121 | 114 |
122 if (self.testRunner) | 115 if (self.testRunner) |
123 testRunner.notifyDone(); | 116 testRunner.notifyDone(); |
124 } | 117 } |
125 | 118 |
126 if (document.readyState === 'loading') { | 119 if (document.readyState === 'loading') { |
127 window.addEventListener('load', done); | 120 window.addEventListener('load', done); |
128 } else { | 121 } else { |
129 setTimeout(done, 0); | 122 setTimeout(done, 0); |
130 } | 123 } |
131 }); | 124 }); |
OLD | NEW |