|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=478251 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 478251</title> |
|
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
10 </head> |
|
11 <body> |
|
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=478251">Mozilla Bug 478251</a> |
|
13 <p id="display"><iframe id="t"></iframe></p> |
|
14 <div id="content" style="display: none"> |
|
15 |
|
16 </div> |
|
17 <pre id="test"> |
|
18 <script type="application/javascript"> |
|
19 |
|
20 SimpleTest.expectAssertions(9, 10); |
|
21 |
|
22 /** Test for Bug 478251 **/ |
|
23 var doc = $("t").contentDocument; |
|
24 doc.open(); |
|
25 doc.write(); |
|
26 doc.close(); |
|
27 is(doc.documentElement.textContent, "", "Writing || failed"); |
|
28 |
|
29 doc.open(); |
|
30 doc.write(null); |
|
31 doc.close(); |
|
32 is(doc.documentElement.textContent, "null", "Writing |null| failed"); |
|
33 |
|
34 doc.open(); |
|
35 doc.write(null, null); |
|
36 doc.close(); |
|
37 is(doc.documentElement.textContent, "nullnull", "Writing |null, null| failed"); |
|
38 |
|
39 doc.open(); |
|
40 doc.write(undefined); |
|
41 doc.close(); |
|
42 is(doc.documentElement.textContent, "undefined", "Writing |undefined| failed"); |
|
43 |
|
44 doc.open(); |
|
45 doc.write(undefined, undefined); |
|
46 doc.close(); |
|
47 is(doc.documentElement.textContent, "undefinedundefined", "Writing |undefined, undefined| failed"); |
|
48 |
|
49 doc.open(); |
|
50 doc.writeln(); |
|
51 doc.close(); |
|
52 ok(doc.documentElement.textContent == "\n" || doc.documentElement.textContent == "", "Writing |\\n| failed"); |
|
53 |
|
54 doc.open(); |
|
55 doc.writeln(null); |
|
56 doc.close(); |
|
57 is(doc.documentElement.textContent, "null\n", "Writing |null\\n| failed"); |
|
58 |
|
59 doc.open(); |
|
60 doc.writeln(null, null); |
|
61 doc.close(); |
|
62 is(doc.documentElement.textContent, "nullnull\n", "Writing |null, null\\n| failed"); |
|
63 |
|
64 doc.open(); |
|
65 doc.writeln(undefined); |
|
66 doc.close(); |
|
67 is(doc.documentElement.textContent, "undefined\n", "Writing |undefined\\n| failed"); |
|
68 |
|
69 doc.open(); |
|
70 doc.writeln(undefined, undefined); |
|
71 doc.close(); |
|
72 is(doc.documentElement.textContent, "undefinedundefined\n", "Writing |undefined, undefined\\n| failed"); |
|
73 </script> |
|
74 </pre> |
|
75 </body> |
|
76 </html> |