Skip to content

Commit ce98550

Browse files
committed
Failing atob test case for malformed input
This should catch a regression potentially introduced in 7a3c32b
1 parent cb9dc19 commit ce98550

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/test/java/org/htmlunit/javascript/host/Window2Test.java

+18
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,24 @@ public void atob() throws Exception {
181181
loadPageVerifyTitle2(html);
182182
}
183183

184+
/**
185+
* @throws Exception if the test fails
186+
*/
187+
@Test
188+
@Alerts({"InvalidCharacterError/DOMException"})
189+
public void atobMalformedInput() throws Exception {
190+
final String html
191+
= "<html><head></head><body>\n"
192+
+ "<script>\n"
193+
+ LOG_TITLE_FUNCTION
194+
+ " try {\n"
195+
+ " window.atob('b');\n"
196+
+ " } catch(e) {logEx(e)}\n"
197+
+ "</script>\n"
198+
+ "</body></html>";
199+
loadPageVerifyTitle2(html);
200+
}
201+
184202
/**
185203
* @throws Exception if the test fails
186204
*/

0 commit comments

Comments
 (0)