1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.javascript.host.html;
16
17 import org.htmlunit.WebDriverTestCase;
18 import org.htmlunit.junit.annotation.Alerts;
19 import org.junit.jupiter.api.Test;
20
21
22
23
24
25
26 public class HTMLDDElementTest extends WebDriverTestCase {
27
28
29
30
31 @Test
32 @Alerts({"undefined", "null", "nowrap", "null", "x", "null", "x", "blah", "", "blah"})
33 public void noWrap() throws Exception {
34 final String html = DOCTYPE_HTML
35 + "<html>\n"
36 + " <head>\n"
37 + " <script>\n"
38 + LOG_TITLE_FUNCTION
39 + " function test() {\n"
40 + " var dd = document.getElementById('test');\n"
41 + " log(dd.noWrap);\n"
42 + " log(dd.getAttribute('noWrap'));\n"
43 + " dd.noWrap = 'nowrap';\n"
44 + " log(dd.noWrap);\n"
45 + " log(dd.getAttribute('noWrap'));\n"
46 + " dd.noWrap = 'x';\n"
47 + " log(dd.noWrap);\n"
48 + " log(dd.getAttribute('noWrap'));\n"
49 + " dd.setAttribute('noWrap', 'blah');\n"
50 + " log(dd.noWrap);\n"
51 + " log(dd.getAttribute('noWrap'));\n"
52 + " dd.noWrap = '';\n"
53 + " log(dd.noWrap);\n"
54 + " log(dd.getAttribute('noWrap'));\n"
55 + " }\n"
56 + " </script>\n"
57 + " </head>\n"
58 + " <body onload='test()'>\n"
59 + " <dl><dd id='test'>dd</dd></dl>\n"
60 + " </body>\n"
61 + "</html>";
62
63 loadPageVerifyTitle2(html);
64 }
65 }