Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(684)

Side by Side Diff: LayoutTests/fast/dom/TreeWalker/TreeWalker-basic.html

Issue 366223006: createTreeWalker and createNodeIterator should deal with null NodeFilter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use fully qualified variable name Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>TreeWalker: Basic test</title> 4 <title>TreeWalker: Basic test</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> 10 <p>This test checks the basic functionality of TreeWalker.</p>
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 { 112 {
113 var filter = function () { 113 var filter = function () {
114 return NodeFilter.FILTER_ACCEPT; 114 return NodeFilter.FILTER_ACCEPT;
115 }; 115 };
116 [true, false].forEach(function (expandEntityReferences) { 116 [true, false].forEach(function (expandEntityReferences) {
117 var walker = document.createTreeWalker(createSampleDOM(), NodeFilter.SHO W_ALL, filter, expandEntityReferences); 117 var walker = document.createTreeWalker(createSampleDOM(), NodeFilter.SHO W_ALL, filter, expandEntityReferences);
118 assert_true(walker instanceof TreeWalker); 118 assert_true(walker instanceof TreeWalker);
119 assert_false(walker.expandEntityReferences); 119 assert_false(walker.expandEntityReferences);
120 }); 120 });
121 }, 'Test that the fourth argument (expandEntityReferences) is ignored.'); 121 }, 'Test that the fourth argument (expandEntityReferences) is ignored.');
122
123 test(function() {
124 var treeWalker = document.createTreeWalker(document.body, 42, null);
125 assert_equals(treeWalker.root, document.body);
126 assert_equals(treeWalker.currentNode, document.body);
127 assert_equals(treeWalker.whatToShow, 42);
128 assert_equals(treeWalker.filter, null);
129 }, "Optional arguments to createTreeWalker should be optional (3 passed, null)." );
122 </script> 130 </script>
123 </body> 131 </body>
124 </html> 132 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698