summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responseXML-invalid-xml.html
blob: 2b50d210020f77a1f6e4578bb458c1c7f9f3ab24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE html>
<html>
<head>
    <script src="../../resources/js-test.js"></script>
    <script>
        description('This tests the XMLHttpRequest responseXML attribute value when given invalid XML data.');

        window.jsTestIsAsync = true;
        var xhr = new XMLHttpRequest(),
            url = 'resources/xmlhttprequest-get-invalid-data.xml';
        xhr.onload = function() {
            shouldEvaluateTo('xhr.readyState', 4);
            shouldBeNull('xhr.responseXML');
            finishJSTest();
        };
        xhr.onerror = function() {
            testFailed('The XHR request to an existing resource failed: "' + url + '"');
            finishJSTest();
        };
        xhr.open('GET', url);
        xhr.responseType = 'document';
        xhr.send(null);
    </script>
</head>
<body>
    <div id="description"></div>
    <div id="console"></div>
</body>
</html>