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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/Document-createTreeWalker.html

Issue 1529523002: Import dom/ from web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak W3CImportExpectations Created 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <meta charset=utf-8>
3 <title>Document.createTreeWalker</title>
4 <script src=../../../../resources/testharness.js></script>
5 <script src=../../../../resources/testharnessreport.js></script>
6 <div id=log></div>
7 <script>
8 test(function() {
9 assert_throws(new TypeError(), function() {
10 document.createTreeWalker();
11 });
12 }, "Required arguments to createTreeWalker should be required.");
13 test(function() {
14 var tw = document.createTreeWalker(document.body);
15 assert_equals(tw.root, document.body);
16 assert_equals(tw.currentNode, document.body);
17 assert_equals(tw.whatToShow, 0xFFFFFFFF);
18 assert_equals(tw.filter, null);
19 }, "Optional arguments to createTreeWalker should be optional (1 passed).");
20 test(function() {
21 var tw = document.createTreeWalker(document.body, 42);
22 assert_equals(tw.root, document.body);
23 assert_equals(tw.currentNode, document.body);
24 assert_equals(tw.whatToShow, 42);
25 assert_equals(tw.filter, null);
26 }, "Optional arguments to createTreeWalker should be optional (2 passed).");
27 test(function() {
28 var tw = document.createTreeWalker(document.body, 42, null);
29 assert_equals(tw.root, document.body);
30 assert_equals(tw.currentNode, document.body);
31 assert_equals(tw.whatToShow, 42);
32 assert_equals(tw.filter, null);
33 }, "Optional arguments to createTreeWalker should be optional (3 passed, null)." );
34 test(function() {
35 var fn = function() {};
36 var tw = document.createTreeWalker(document.body, 42, fn);
37 assert_equals(tw.root, document.body);
38 assert_equals(tw.currentNode, document.body);
39 assert_equals(tw.whatToShow, 42);
40 assert_equals(tw.filter, fn);
41 }, "Optional arguments to createTreeWalker should be optional (3 passed, functio n).");
42 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698