Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / xmlhttprequest / xmlhttprequest-html-response-encoding.html
blobe2d0ecf4dc39065805b4233f2cd89e63cf712af1
1 <html>
2 <head>
3 <title>Test XmlHttpRequest response encoding handling</title>
4 </head>
5 <body>
6 <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=14288">bug 14288</a>:
7 XMLHttpRequest doesn't use a correct content type for file:// URLs.</p>
8 <script>
10 if (window.testRunner) {
11 testRunner.dumpAsText();
12 testRunner.waitUntilDone();
15 var console_messages = document.createElement("ol");
16 document.body.appendChild(console_messages);
18 var asyncStep = 1;
20 function log(message)
22 var item = document.createElement("li");
23 item.appendChild(document.createTextNode(message));
24 console_messages.appendChild(item);
27 function get(url, async)
29 if (window.XMLHttpRequest) {
30 req = new XMLHttpRequest();
31 } else {
32 try {
33 req = new ActiveXObject("Msxml2.XMLHTTP");
34 } catch (ex) {
35 req = new ActiveXObject("Microsoft.XMLHTTP");
39 if (async)
40 req.onreadystatechange = processStateChange;
42 req.open('GET', url, async);
43 req.send(null);
45 return req;
48 function processStateChange(){
49 if (req.readyState == 4) {
50 log("Async: HTML, charset determined by a META: " + req.responseText.replace(/\s/g, "").replace(/.*<body>(.*)<\/body>.*/, "$1"));
51 if (window.testRunner)
52 testRunner.notifyDone();
56 try {
57 req = get('resources/1251.html', false);
58 log("HTML, charset determined by a META: " + req.responseText.replace(/\s/g, "").replace(/.*<body>(.*)<\/body>.*/, "$1"));
59 } catch (ex) {
60 log("Exception: " + ex.description);
63 get('resources/1251.html', true);
65 </script>
66 </body>
67 </html>