Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / undetectable-document-all.html
blob0fa3c89b967af45ea868e645999a995debdf294a
1 <html>
2 <head>
3 <script>
4 function debug(str) {
5 var c = document.getElementById('console')
6 c.innerHTML += (str + "<br>")
9 function runTests() {
10 if (window.testRunner)
11 testRunner.dumpAsText();
13 debug('document.all: ' + document.all)
15 if (document.all) {
16 debug('FAILURE: document.all should evaluate to false')
17 return;
20 if (!document.all) {
21 // Do nothing
22 } else {
23 debug('FAILURE: document.all should evaluate to false')
24 return;
26 if (document.all != undefined) {
27 debug('FAILURE: document.all != undefined should evaluate to false ')
28 return;
31 if (undefined != document.all) {
32 debug('FAILURE: undefined != document.all should evaluate to false ')
33 return;
36 if (document.all != null) {
37 debug('FAILURE: document.all != null should evaluate to false')
38 return;
41 if (null != document.all) {
42 debug('FAILURE: null != document.all should evaluate to false')
43 return;
46 // Try replacing document.all with something else
47 document.all = { 'foo': 42}
49 if (document.all.foo != 42) {
50 debug('FAILURE: replacing document.all did not work')
51 return;
54 // Delete new document.all
55 delete(document.all)
57 if (document.all.foo != undefined) {
58 debug('FAILURE: deleting replace document.all did not work')
59 return;
62 // Check typeof document.all
63 if (typeof document.all != 'undefined') {
64 debug('FAILURE: typeof document.all should be undefined');
65 return;
68 debug('SUCCESS!')
70 </script>
71 </head>
72 <body onload="runTests();">
73 This tests that document.all should be undetectable, and that it should be possible to set document.all to something else. If this test is successful, the text "SUCCESS" should be shown below.
74 <pre id="console"></pre>
75 </body>
76 </html>