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

Method get

src/test/java/org/htmlunit/javascript/host/MapTest.java:34–54  ·  view source on GitHub ↗

@throws Exception if the test fails

()

Source from the content-addressed store, hash-verified

32 * @throws Exception if the test fails
33 */
34 @Test
35 @Alerts({"3", "value1"})
36 public void get() throws Exception {
37 final String html = DOCTYPE_HTML
38 + "<html><head>\n"
39 + "<script>\n"
40 + LOG_TITLE_FUNCTION
41 + " function test() {\n"
42 + " if (window.Map) {\n"
43 + " var kvArray = [['key1', 'value1'], ['key2', 'value2']];\n"
44 + " var myMap = new Map(kvArray);\n"
45 + " myMap.set(1, 2);\n"
46 + " log(myMap.size);\n"
47 + " log(myMap.get('key1'));\n"
48 + " }\n"
49 + " }\n"
50 + "</script></head><body onload='test()'>\n"
51 + "</body></html>";
52
53 loadPageVerifyTitle2(html);
54 }
55
56 /**
57 * @throws Exception if the test fails

Callers 15

postMethod · 0.45
historyCacheMethod · 0.45
clearCookiesMethod · 0.45
sameSiteMethod · 0.45

Calls 1

loadPageVerifyTitle2Method · 0.80

Tested by

no test coverage detected