| OLD | NEW |
| 1 /* | 1 /* |
| 2 * testharness-helpers contains various useful extensions to testharness.js to | 2 * testharness-helpers contains various useful extensions to testharness.js to |
| 3 * allow them to be used across multiple tests before they have been | 3 * allow them to be used across multiple tests before they have been |
| 4 * upstreamed. This file is intended to be usable from both document and worker | 4 * upstreamed. This file is intended to be usable from both document and worker |
| 5 * environments, so code should for example not rely on the DOM. | 5 * environments, so code should for example not rely on the DOM. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 // Returns a promise that fulfills after the provided |promise| is fulfilled. | 8 // Returns a promise that fulfills after the provided |promise| is fulfilled. |
| 9 // The |test| succeeds only if |promise| rejects with an exception matching | 9 // The |test| succeeds only if |promise| rejects with an exception matching |
| 10 // |code|. Accepted values for |code| follow those accepted for assert_throws(). | 10 // |code|. Accepted values for |code| follow those accepted for assert_throws(). |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 if (typeof src != "object") | 154 if (typeof src != "object") |
| 155 return src; | 155 return src; |
| 156 var dst = Array.isArray(src) ? [] : {}; | 156 var dst = Array.isArray(src) ? [] : {}; |
| 157 for (var property in src) { | 157 for (var property in src) { |
| 158 dst[property] = deepCopy(src[property]); | 158 dst[property] = deepCopy(src[property]); |
| 159 } | 159 } |
| 160 return dst; | 160 return dst; |
| 161 } | 161 } |
| 162 return JSON.stringify(deepCopy(object)); | 162 return JSON.stringify(deepCopy(object)); |
| 163 } | 163 } |
| OLD | NEW |