OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>TreeWalker: Basic test</title> | 4 <title>This test checks the basic functionality of TreeWalker.</title> |
5 <script src="../../../resources/testharness.js"></script> | 5 <script src="../../../resources/testharness.js"></script> |
6 <script src="../../../resources/testharnessreport.js"></script> | 6 <script src="../../../resources/testharnessreport.js"></script> |
7 <link rel="stylesheet" href="../../../resources/testharness.css"> | 7 <link rel="stylesheet" href="../../../resources/testharness.css"> |
8 </head> | 8 </head> |
9 <body> | 9 <body> |
10 <p>This test checks the basic functionality of TreeWalker.</p> | |
11 <script> | 10 <script> |
12 function createSampleDOM() | 11 function createSampleDOM() |
13 { | 12 { |
14 // Tree structure: | 13 // Tree structure: |
15 // #a | 14 // #a |
16 // | | 15 // | |
17 // +----+----+ | 16 // +----+----+ |
18 // | | | 17 // | | |
19 // "b" #c | 18 // "b" #c |
20 // | | 19 // | |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 test(function() { | 122 test(function() { |
124 var treeWalker = document.createTreeWalker(document.body, 42, null); | 123 var treeWalker = document.createTreeWalker(document.body, 42, null); |
125 assert_equals(treeWalker.root, document.body); | 124 assert_equals(treeWalker.root, document.body); |
126 assert_equals(treeWalker.currentNode, document.body); | 125 assert_equals(treeWalker.currentNode, document.body); |
127 assert_equals(treeWalker.whatToShow, 42); | 126 assert_equals(treeWalker.whatToShow, 42); |
128 assert_equals(treeWalker.filter, null); | 127 assert_equals(treeWalker.filter, null); |
129 }, "Optional arguments to createTreeWalker should be optional (3 passed, null)."
); | 128 }, "Optional arguments to createTreeWalker should be optional (3 passed, null)."
); |
130 </script> | 129 </script> |
131 </body> | 130 </body> |
132 </html> | 131 </html> |
OLD | NEW |