MCPcopy Create free account
hub / github.com/HtmlUnit/htmlunit / toJSON

Method toJSON

src/test/java/org/htmlunit/javascript/host/URLTest.java:1197–1212  ·  view source on GitHub ↗

@throws Exception if an error occurs

()

Source from the content-addressed store, hash-verified

1195 * @throws Exception if an error occurs
1196 */
1197 @Test
1198 @Alerts("https://developer.mozilla.org/")
1199 public void toJSON() throws Exception {
1200 final String html = DOCTYPE_HTML
1201 + "<html><body>\n"
1202 + "<script>\n"
1203 + LOG_TITLE_FUNCTION
1204 + " if (typeof window.URL === 'function') {\n"
1205 + " var u = new URL('/', 'https://developer.mozilla.org');\n"
1206 + " log(u.toJSON());\n"
1207 + " }\n"
1208 + "</script>\n"
1209 + "</body></html>";
1210
1211 loadPageVerifyTitle2(html);
1212 }
1213
1214 /**
1215 * @throws Exception if the test fails

Callers 15

strFunction · 0.45
stringifyFunction · 0.45
stringifyFunction · 0.45
adapter.jsFile · 0.45
prototype.jsFile · 0.45
prototype.jsFile · 0.45
StrFunction · 0.45
toJSONFunction · 0.45
array_test.jsFile · 0.45
hash_test.jsFile · 0.45

Calls 1

loadPageVerifyTitle2Method · 0.80

Tested by

no test coverage detected