OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../js/resources/js-test-pre.js"></script> | 4 <script src="../js/resources/js-test-pre.js"></script> |
5 <script> | 5 <script> |
6 description('This tests the XMLHttpRequest responseXML loading an XML do
cument with responseType "document".'); | 6 description('This tests the XMLHttpRequest responseXML loading an XML do
cument with responseType "document".'); |
7 | 7 |
8 window.jsTestIsAsync = true; | 8 window.jsTestIsAsync = true; |
9 var xhr = new XMLHttpRequest(), | 9 var xhr = new XMLHttpRequest(), |
10 url = 'resources/xmlhttprequest-get-data.xml', | 10 url = 'resources/xmlhttprequest-get-data.xml', |
11 id3; | 11 id3; |
12 xhr.onload = function() { | 12 xhr.onload = function() { |
13 shouldBeNonNull('xhr.responseXML'); | 13 shouldBeNonNull('xhr.responseXML'); |
14 shouldBeTrue('xhr.responseXML instanceof Document'); | 14 shouldBeTrue('xhr.responseXML instanceof Document'); |
15 | 15 |
16 id3 = xhr.responseXML.getElementById('id3'); | 16 id3 = xhr.responseXML.getElementById('id3'); |
17 shouldBeNonNull('id3'); | 17 shouldBeNonNull('id3'); |
18 shouldBeEqualToString('id3.textContent', 'Three'); | 18 shouldBeEqualToString('id3.textContent', 'Three'); |
19 | 19 |
20 finishJSTest(); | 20 finishJSTest(); |
21 }; | 21 }; |
22 xhr.onerror = function() { | 22 xhr.onerror = function() { |
23 testFailed('The XHR request to an existing resource failed: "' + url
+ '"'); | 23 testFailed('The XHR request to an existing resource failed: "' + url
+ '"'); |
24 finishJSTest(); | 24 finishJSTest(); |
25 }; | 25 }; |
26 xhr.open('GET', url); | 26 xhr.open('GET', url); |
27 xhr.responseType = 'document'; | 27 xhr.responseType = 'document'; |
28 xhr.send(null); | 28 xhr.send(null); |
29 </script> | 29 </script> |
30 <script src="../js/resources/js-test-post.js"></script> | |
31 </head> | 30 </head> |
32 <body> | 31 <body> |
33 <div id="description"></div> | 32 <div id="description"></div> |
34 <div id="console"></div> | 33 <div id="console"></div> |
35 </body> | 34 </body> |
36 </html> | 35 </html> |
OLD | NEW |