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

Side by Side Diff: LayoutTests/http/tests/dom/document-contentType-xhr.html

Issue 151653004: Implemented Document.contentType (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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>
2 <title>document.contentType</title>
3 <link rel="help" href="http://dom.spec.whatwg.org/#dom-document-contenttype">
4 <script src="/js-test-resources/js-test.js"></script>
5 <body>
6
7 <script>
8 window.jsTestIsAsync = true;
9
10 var to_test = [
11 { mt: "text/html", uri: "resources/send-mime-type.php?m=text/html" },
12 { mt: "text/xml", uri: "resources/send-mime-type.php?m=text/xml" },
13 { mt: "application/xml", uri: "resources/send-mime-type.php?m=applicatio n/xml" },
14 { mt: "text/html", uri: "resources/send-mime-type.php?m=text/html;charse t=utf-8" },
15 { mt: "text/xml", uri: "resources/send-mime-type.php?m=text/xml;charset= utf-8" },
16 { mt: "application/xml", uri: "resources/send-mime-type.php?m=applicatio n/xml;charset=utf-8" }
17 ];
18
19 function _(s) { return '"' + s + '"'; };
arv (Not doing code reviews) 2014/02/11 16:36:10 Use descriptive names
20
21 function onrequestload(expected_mt) {
22 shouldBe(_(this.status), _(200));
23
24 if (this.responseXML)
25 shouldBe(_(this.responseXML.contentType), _(expected_mt));
26 else
27 testFailed("Null document for mime-type " + expected_mt);
28
29 step_test();
30 }
31
32 function step_test() {
33 var this_test = to_test.shift();
34 if (this_test) {
35 var x = new XMLHttpRequest();
36 x.open('GET', this_test.uri, true);
37 x.responseType = 'document';
38 x.onload = onrequestload.bind(x, this_test.mt);
39 x.send('');
40 }
41 else
42 finishJSTest();
43 }
44
45 step_test();
46
47 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698