MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / test

Method test

src/test/java/org/htmlunit/WebClientTest.java:2301–2316  ·  view source on GitHub ↗

Tests that setThrowExceptionOnScriptError also works, if an exception is thrown from onerror handler. Regression test for bug 3534371. @throws Exception if the test fails

()

Source from the content-addressed store, hash-verified

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.

Callers 15

quoteFunction · 0.45
json2.jsFile · 0.45
testSubprojectFunction · 0.45
assetLoadedFunction · 0.45
urlFunction · 0.45
effects.jsFile · 0.45
ajax.jsFile · 0.45
attributes.jsFile · 0.45
manipulation.jsFile · 0.45
testHtmlFunction · 0.45
support.jsFile · 0.45
narwhal-test.jsFile · 0.45

Calls 5

getOptionsMethod · 0.95
setJavaScriptEnabledMethod · 0.80
getWebClientMethod · 0.65
loadPageMethod · 0.45

Tested by

no test coverage detected