Tests that setThrowExceptionOnScriptError also works, if an exception is thrown from onerror handler. Regression test for bug 3534371. @throws Exception if the test fails
()
| 2299 | * @throws Exception if the test fails |
| 2300 | */ |
| 2301 | @Test |
| 2302 | public void test() throws Exception { |
| 2303 | final String html = DOCTYPE_HTML |
| 2304 | + "<html><body>\n" |
| 2305 | + "<script type='application/javascript'>\n" |
| 2306 | + " window.onerror = function() { foo.bar() };\n" |
| 2307 | + " doit();\n" |
| 2308 | + "</script>\n" |
| 2309 | + "</body></html>"; |
| 2310 | |
| 2311 | final WebClient webClient = getWebClient(); |
| 2312 | webClient.getOptions().setJavaScriptEnabled(true); |
| 2313 | webClient.getOptions().setThrowExceptionOnScriptError(false); |
| 2314 | |
| 2315 | loadPage(html); |
| 2316 | } |
| 2317 | |
| 2318 | /** |
| 2319 | * Testcase for issue #1652. |
no test coverage detected