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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/html/xhtml-serialize.html

Issue 2667303004: Move tests for DOMParser and XMLSerializer to dom/domparsing/. (Closed)
Patch Set: Created 3 years, 10 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
(Empty)
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <body>
4 <p>This test checks whether serialized invalid XHTML is valid XML (for bug 9901) .</p>
5 <p>If the test passes, you'll see a series of 'PASS' messages below.</p>
6 <pre id="console"></pre>
7
8 <script>
9 if (window.testRunner)
10 testRunner.dumpAsText();
11
12 function log(s)
13 {
14 document.getElementById('console').appendChild(document.createTextNode(s));
15 }
16
17 function shouldBe(a, b)
18 {
19 var evalA;
20 try {
21 evalA = eval(a);
22 } catch(e) {
23 evalA = e;
24 }
25
26 if (evalA == b)
27 log('PASS: ' + a + ' should be ' + b + ' and is.\n');
28 else
29 log('FAIL: ' + a + ' should be ' + b + ' but instead is ' + evalA + '.\n ');
30 }
31
32 var doc = (new DOMParser()).parseFromString('<input xmlns="http://www.w3.org/199 9/xhtml">123</input>', 'text/xml');
33 var str = (new XMLSerializer()).serializeToString(doc);
34
35 shouldBe('doc.firstChild.firstChild.nodeValue', '123');
36 shouldBe('str', '<input xmlns=\"http://www.w3.org/1999/xhtml\">123</input>');
37 </script>
38 </body>
39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698