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 * |
11 * For more documentation about the callback functions and the | 11 * For more documentation about the callback functions and the |
12 * parameters they are called with see testharness.js | 12 * parameters they are called with see testharness.js |
13 */ | 13 */ |
14 | 14 |
15 (function() { | 15 (function() { |
16 | 16 |
17 // Setup for WebKit JavaScript tests | 17 // Setup for WebKit JavaScript tests |
18 if (self.testRunner) { | 18 if (self.testRunner) { |
19 testRunner.dumpAsText(); | 19 testRunner.dumpAsText(); |
20 testRunner.waitUntilDone(); | 20 testRunner.waitUntilDone(); |
21 testRunner.setCanOpenWindows(); | 21 testRunner.setCanOpenWindows(); |
22 testRunner.setCloseRemainingWindowsWhenComplete(true); | 22 testRunner.setCloseRemainingWindowsWhenComplete(true); |
23 testRunner.setDumpJavaScriptDialogs(false); | 23 testRunner.setDumpJavaScriptDialogs(false); |
24 } | 24 } |
25 | 25 |
26 // Disable the default output of testharness.js. The default output formats | 26 // Disable the default output of testharness.js. The default output formats |
27 // test results into an HTML table. When that table is dumped as text, no | 27 // test results into an HTML table. When that table is dumped as text, no |
28 // spacing between cells is preserved, and it is therefore not readable. By | 28 // spacing between cells is preserved, and it is therefore not readable. By |
29 // setting output to false, the HTML table will not be created. | 29 // setting output to false, the HTML table will not be created. |
30 setup({"output":false}); | 30 // Also, disable timeout (except for explicit timeout), since the Blink |
| 31 // layout test runner has its own timeout mechanism. |
| 32 // See: https://github.com/w3c/testharness.js/blob/master/docs/api.md#setup |
| 33 setup({ |
| 34 "output": false, |
| 35 "explicit_timeout": true |
| 36 }); |
31 | 37 |
32 // Function used to convert the test status code into the corresponding | 38 // Function used to convert the test status code into the corresponding |
33 // string | 39 // string |
34 function convertResult(resultStatus) { | 40 function convertResult(resultStatus) { |
35 switch (resultStatus) { | 41 switch (resultStatus) { |
36 case 0: | 42 case 0: |
37 return "PASS"; | 43 return "PASS"; |
38 case 1: | 44 case 1: |
39 return "FAIL"; | 45 return "FAIL"; |
40 case 2: | 46 case 2: |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // another completion callback might generate more results. So, we | 239 // another completion callback might generate more results. So, we |
234 // don't dump the results immediately. | 240 // don't dump the results immediately. |
235 setTimeout(done, 0); | 241 setTimeout(done, 0); |
236 } else { | 242 } else { |
237 // Parsing the test HTML isn't finished yet. | 243 // Parsing the test HTML isn't finished yet. |
238 window.addEventListener('load', done); | 244 window.addEventListener('load', done); |
239 } | 245 } |
240 }); | 246 }); |
241 | 247 |
242 })(); | 248 })(); |
OLD | NEW |