@throws Exception if an error occurs
()
| 33 | * @throws Exception if an error occurs |
| 34 | */ |
| 35 | @Test |
| 36 | @Alerts("body onLoad") |
| 37 | public void onLoad() throws Exception { |
| 38 | getWebClientWithMockWebConnection().getOptions().setCssEnabled(false); |
| 39 | getMockWebConnection().setResponse(new URL(URL_FIRST, "simple.css"), ""); |
| 40 | |
| 41 | final String html = DOCTYPE_HTML |
| 42 | + "<html>\n" |
| 43 | + "<head>\n" |
| 44 | + " <link rel='stylesheet' href='simple.css' " |
| 45 | + "onload='alert(\"onLoad\")' onerror='alert(\"onError\")'>\n" |
| 46 | + "</head>\n" |
| 47 | + "<body onload='alert(\"body onLoad\")'>\n" |
| 48 | + "</body>\n" |
| 49 | + "</html>"; |
| 50 | |
| 51 | loadPageWithAlerts(html); |
| 52 | assertEquals(1, getMockWebConnection().getRequestCount()); |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * @throws Exception if an error occurs |
no test coverage detected