blob: 4b7c05205413af642f0f47dded3021ef4acba3e5 [file] [log] [blame]
Tests parameters of document.createTreeWalker() API.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
No parameters
PASS document.createTreeWalker() threw exception TypeError: Not enough arguments.
Null root node
PASS document.createTreeWalker(null) threw exception TypeError: Argument 1 ('root') to Document.createTreeWalker must be an instance of Node.
Primitive (string) NodeFilter callback
PASS document.createTreeWalker(document, null, 'str') threw exception TypeError: Argument 3 ('filter') to Document.createTreeWalker must be an object.
Default parameters
walker = document.createTreeWalker(document)
PASS walker.root is document
PASS walker.currentNode is document
PASS walker.whatToShow is 0xFFFFFFFF
PASS walker.filter is null
Passing null for optional parameters
walker = document.createTreeWalker(document, null, null)
PASS walker.root is document
PASS walker.currentNode is document
PASS walker.whatToShow is 0
PASS walker.filter is null
Passing undefined for optional parameters
walker = document.createTreeWalker(document, undefined, undefined)
PASS walker.root is document
PASS walker.currentNode is document
PASS walker.whatToShow is 0xFFFFFFFF
PASS walker.filter is null
PASS successfullyParsed is true
TEST COMPLETE