* Cleans up any HTML elements that tests might have added to the document.
()
| 178 | * Cleans up any HTML elements that tests might have added to the document. |
| 179 | */ |
| 180 | function cleanupTestPageElements() { |
| 181 | const cleanupTagNames = ['link', 'meta', 'iframe']; |
| 182 | const cleanup = document.querySelectorAll(cleanupTagNames.join(',')); |
| 183 | for (let i = 0; i < cleanup.length; i++) { |
| 184 | try { |
| 185 | const element = cleanup[i]; |
| 186 | removeElement(element); |
| 187 | } catch (e) { |
| 188 | // This sometimes fails for unknown reasons. |
| 189 | console./*OK*/ log(e); |
| 190 | } |
| 191 | } |
| 192 | } |
no test coverage detected