1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.javascript.host;
16
17 import org.htmlunit.WebDriverTestCase;
18 import org.htmlunit.junit.annotation.Alerts;
19 import org.htmlunit.junit.annotation.HtmlUnitNYI;
20 import org.junit.jupiter.api.Test;
21
22
23
24
25
26
27
28
29 public class NetscapeTest extends WebDriverTestCase {
30
31
32
33
34 @Test
35 @Alerts(DEFAULT = {"undefined", "undefined", "TypeError"},
36 FF = {"[object Object]", "undefined", "[object Object]", "undefined"},
37 FF_ESR = {"[object Object]", "undefined", "[object Object]", "undefined"})
38 public void netscape() throws Exception {
39 final String html = DOCTYPE_HTML
40 + "<html><body>\n"
41 + "<script>\n"
42 + LOG_TITLE_FUNCTION
43 + "try {\n"
44 + " log(window.netscape);\n"
45 + " log(window.Netscape);\n"
46 + " log(window.netscape.security);\n"
47 + " log(window.netscape.security.PrivilegeManager);\n"
48 + "} catch(e) { logEx(e); }\n"
49 + "</script></body></html>";
50
51 loadPageVerifyTitle2(html);
52 }
53
54
55
56
57
58 @Test
59 @Alerts(DEFAULT = "TypeError",
60 FF = {"true", "false", "true"},
61 FF_ESR = {"true", "false", "true"})
62 @HtmlUnitNYI(FF = {"undefined", "true", "true"},
63 FF_ESR = {"undefined", "true", "true"})
64 public void netscapeDescriptor() throws Exception {
65 final String html = DOCTYPE_HTML
66 + "<html><body>\n"
67 + "<script>\n"
68 + LOG_TITLE_FUNCTION
69 + "try {\n"
70 + " var d1 = Object.getOwnPropertyDescriptor(window, 'netscape');\n"
71 + " log(d1.writable);\n"
72 + " log(d1.enumerable);\n"
73 + " log(d1.configurable);\n"
74 + "} catch(e) { logEx(e); }\n"
75 + "</script></body></html>";
76
77 loadPageVerifyTitle2(html);
78 }
79 }