| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 input_script.setAttribute('src', path); | 84 input_script.setAttribute('src', path); |
| 85 document.head.appendChild(input_script); | 85 document.head.appendChild(input_script); |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 | 88 |
| 89 var didDispatchLoadEvent = false; | 89 var didDispatchLoadEvent = false; |
| 90 var handleLoad = function() { | 90 var handleLoad = function() { |
| 91 didDispatchLoadEvent = true; | 91 didDispatchLoadEvent = true; |
| 92 window.removeEventListener('load', handleLoad); | 92 window.removeEventListener('load', handleLoad); |
| 93 // Add synthetic input to pointer event manual tests | 93 // Add synthetic input to pointer event manual tests |
| 94 if(window.location.pathname.includes('imported/wpt/pointerevents/')) { | 94 if(window.location.pathname.includes('imported/wpt/pointerevents/') |
| 95 || window.location.pathname.includes('imported/wpt/uievents/')) { |
| 95 setTimeout(injectSyntheticInput, 0); | 96 setTimeout(injectSyntheticInput, 0); |
| 96 } | 97 } |
| 97 }; | 98 }; |
| 98 window.addEventListener('load', handleLoad, false); | 99 window.addEventListener('load', handleLoad, false); |
| 99 | 100 |
| 100 // Using a callback function, test results will be added to the page in a | 101 // Using a callback function, test results will be added to the page in a |
| 101 // manner that allows dumpAsText to produce readable test results. | 102 // manner that allows dumpAsText to produce readable test results. |
| 102 add_completion_callback(function (tests, harness_status) { | 103 add_completion_callback(function (tests, harness_status) { |
| 103 | 104 |
| 104 // Create element to hold results. | 105 // Create element to hold results. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // another completion callback might generate more results. So, we | 159 // another completion callback might generate more results. So, we |
| 159 // don't dump the results immediately. | 160 // don't dump the results immediately. |
| 160 setTimeout(done, 0); | 161 setTimeout(done, 0); |
| 161 } else { | 162 } else { |
| 162 // Parsing the test HTML isn't finished yet. | 163 // Parsing the test HTML isn't finished yet. |
| 163 window.addEventListener('load', done); | 164 window.addEventListener('load', done); |
| 164 } | 165 } |
| 165 }); | 166 }); |
| 166 | 167 |
| 167 })(); | 168 })(); |
| OLD | NEW |