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

Unified Diff: LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html

Issue 106423002: Remove fourth argument to createNodeIterator/createTreeWalker (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: base files Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/NodeIterator/NodeIterator-basic-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html
diff --git a/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html b/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html
index bc918eeaba514a40580f8b71723024cf90cbbddc..6e8f7e3e4f115086ac8627bea3f60f9063a74370 100644
--- a/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html
+++ b/LayoutTests/fast/dom/NodeIterator/NodeIterator-basic.html
@@ -94,22 +94,23 @@ function testIteratorForwardAndBackward(iterator, expectedNodes)
assert_equals(iterator.pointerBeforeReferenceNode, true);
}
+var expectedAll = [
+ { type: Element, id: 'a' },
+ { type: Text, nodeValue: 'b' },
+ { type: Element, id: 'c' },
+ { type: Element, id: 'd' },
+ { type: Text, nodeValue: 'e' },
+ { type: Element, id: 'f' },
+ { type: Text, nodeValue: 'g' },
+ { type: Comment, nodeValue: 'h' },
+ { type: Text, nodeValue: 'i' },
+ { type: Comment, nodeValue: 'j' },
+];
+
test(function ()
{
- var expected = [
- { type: Element, id: 'a' },
- { type: Text, nodeValue: 'b' },
- { type: Element, id: 'c' },
- { type: Element, id: 'd' },
- { type: Text, nodeValue: 'e' },
- { type: Element, id: 'f' },
- { type: Text, nodeValue: 'g' },
- { type: Comment, nodeValue: 'h' },
- { type: Text, nodeValue: 'i' },
- { type: Comment, nodeValue: 'j' },
- ];
var iterator = document.createNodeIterator(createSampleDOM());
- testIteratorForwardAndBackward(iterator, expected);
+ testIteratorForwardAndBackward(iterator, expectedAll);
}, 'Iterate over all nodes forward then backward.');
test(function ()
@@ -179,6 +180,19 @@ test(function ()
var iterator = document.createNodeIterator(createSampleDOM(), NodeFilter.SHOW_ALL, filter);
testIteratorForwardAndBackward(iterator, expected);
}, 'Test the behavior of NodeIterator when NodeFilter is specified.');
+
+test(function ()
+{
+ var filter = function (node) {
+ return NodeFilter.FILTER_ACCEPT;
+ };
+ [true, false].forEach(function (expandEntityReferences) {
+ var iterator = document.createNodeIterator(createSampleDOM(), NodeFilter.SHOW_ALL, filter, expandEntityReferences);
+ assert_true(iterator instanceof NodeIterator);
+ assert_false(iterator.expandEntityReferences);
+ testIteratorForwardAndBackward(iterator, expectedAll);
+ });
+}, 'Test that the fourth argument (expandEntityReferences) is ignored.');
</script>
</body>
</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/NodeIterator/NodeIterator-basic-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698