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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/domxpath/xml_xpath_runner.html

Issue 2618563002: Skip importing domxpath/xml_xpath_runner.html due to large file. (Closed)
Patch Set: Remove existing file that's now skipped Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/LayoutTests/W3CImportExpectations ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype html>
2 <title>XPath tests</title>
3 <script src='/resources/testharness.js'></script>
4 <script src='/resources/testharnessreport.js'></script>
5 <script>
6 setup({ explicit_done: true });
7
8 function find_child_element(context, element) {
9 for (var i = 0; i < context.childNodes.length; i++) {
10 var child = context.childNodes[i];
11 if (child.nodeType === Node.ELEMENT_NODE && child.tagName === element)
12 return child;
13 }
14 }
15
16 function xpath_test(test_el) {
17 /* note this func adopts the tree! */
18 var new_doc = document.implementation.createDocument("", "");
19 var xpath = find_child_element(test_el, "xpath");
20 var result = find_child_element(test_el, "result");
21 var namespace = find_child_element(result, "namespace");
22 var localname = find_child_element(result, "localname");
23 var nth = find_child_element(result, "nth");
24 var tree = find_child_element(test_el, "tree");
25 var actual_tree = new_doc.adoptNode(tree.firstElementChild);
26 new_doc.appendChild(actual_tree);
27 test(function() {
28 var result = new_doc.evaluate(xpath.textContent, // expression
29 actual_tree, // context node
30 new_doc.createNSResolver(actual_tree), // reso lver
31 XPathResult.ANY_TYPE, // type
32 null); // result
33 var matched = [];
34 var cur;
35 while ((cur = result.iterateNext()) !== null) {
36 matched.push(cur);
37 }
38 assert_equals(matched.length, 1, "Should match one node");
39 var similar = new_doc.getElementsByTagNameNS(namespace.textContent,
40 localname.textContent);
41 assert_equals(matched[0], similar[nth.textContent]);
42 });
43 }
44
45 var xhr = new XMLHttpRequest();
46 xhr.open("GET", "xml_xpath_tests.xml");
47 xhr.onload = function(e) {
48 var tests = xhr.responseXML.documentElement;
49 for (var i = 0; i < tests.childNodes.length; i++) {
50 var child = tests.childNodes[i];
51 if (child.nodeType === Node.ELEMENT_NODE) {
52 xpath_test(child);
53 }
54 }
55 done();
56 };
57 xhr.send();
58 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/W3CImportExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698