| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 if (path.match(/imported\/wpt\/.*\.html$/)) { | 72 if (path.match(/imported\/wpt\/.*\.html$/)) { |
| 73 // Set a global variable for the address of automated input script i
f they need to use it. | 73 // Set a global variable for the address of automated input script i
f they need to use it. |
| 74 var automated_input_scripts_folder = path.replace(/imported\/wpt\/(.
*)\.html$/, 'imported/wpt_automation'); | 74 var automated_input_scripts_folder = path.replace(/imported\/wpt\/(.
*)\.html$/, 'imported/wpt_automation'); |
| 75 | 75 |
| 76 importAutomationScript = function(relativePath) { | 76 importAutomationScript = function(relativePath) { |
| 77 var common_script = document.createElement('script'); | 77 var common_script = document.createElement('script'); |
| 78 common_script.setAttribute('src', automated_input_scripts_folder +
relativePath); | 78 common_script.setAttribute('src', automated_input_scripts_folder +
relativePath); |
| 79 document.head.appendChild(common_script); | 79 document.head.appendChild(common_script); |
| 80 } | 80 } |
| 81 | 81 |
| 82 path = path.replace(/imported\/wpt\/(.*)\.html$/, "imported/wpt_auto
mation/$1-input.js"); | 82 path = path.replace(/imported\/wpt\/(.*)\.html$/, "imported/wpt_auto
mation/$1-automation.js"); |
| 83 var input_script = document.createElement('script'); | 83 var input_script = document.createElement('script'); |
| 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); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // another completion callback might generate more results. So, we | 156 // another completion callback might generate more results. So, we |
| 157 // don't dump the results immediately. | 157 // don't dump the results immediately. |
| 158 setTimeout(done, 0); | 158 setTimeout(done, 0); |
| 159 } else { | 159 } else { |
| 160 // Parsing the test HTML isn't finished yet. | 160 // Parsing the test HTML isn't finished yet. |
| 161 window.addEventListener('load', done); | 161 window.addEventListener('load', done); |
| 162 } | 162 } |
| 163 }); | 163 }); |
| 164 | 164 |
| 165 })(); | 165 })(); |
| OLD | NEW |