OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <meta http-equiv="x-ua-compatible" content="chrome=1" /> | |
4 <title>ChromeFrame conditional header test</title> | |
5 <script type="text/javascript" | |
6 src="chrome_frame_tester_helpers.js"></script> | |
7 | |
8 <script type="text/javascript"> | |
9 function ValidateUserAgent() { | |
10 if (isRunningInMSIE()) { | |
11 onFailure("FullTab_XMLHttpRequestConditionalHeaderTest", 1, | |
12 "Failed"); | |
13 } | |
14 | |
15 SendXHRRequest("if_match", "*"); | |
16 SendXHRRequest("if_modified_since", "*"); | |
17 SendXHRRequest("if-none-match", "*"); | |
18 SendXHRRequest("if-range", "*"); | |
19 SendXHRRequest("if-unmodified-since", "*"); | |
20 onSuccess("FullTab_XMLHttpRequestConditionalHeaderTest", 1); | |
21 } | |
22 | |
23 function SendXHRRequest(conditional_header, value) { | |
24 var test_name = "FullTab_XMLHttpRequestConditionalHeaderTest"; | |
25 var xhr = getXHRObject(); | |
26 if (!xhr) { | |
27 onFailure(test_name, 1, "Failed to get XHR object"); | |
28 } | |
29 | |
30 var request_uri = AppendArgumentsToBaseUrl("echoheader?", | |
31 conditional_header); | |
32 xhr.open("GET", request_uri, false); | |
33 xhr.setRequestHeader(conditional_header, value); | |
34 | |
35 try { | |
36 xhr.send(null); | |
37 var pos = xhr.responseText.indexOf(value); | |
38 if (pos >= 0) { | |
39 appendStatus("Received header: " + xhr.responseText); | |
40 } else { | |
41 onFailure( | |
42 test_name, 1, | |
43 "Failed to find header " + conditional_header + " in response."); | |
44 } | |
45 } catch (e) { | |
46 appendStatus("XHR send failed. Error: " + e.description); | |
47 onFailure(test_name, 1, "Failed to send XHR request"); | |
48 } | |
49 } | |
50 </script> | |
51 </head> | |
52 | |
53 <body onload="setTimeout(ValidateUserAgent, 100);"> | |
54 ChromeFrame full tab mode XMLHttpRequest conditional header test. | |
55 Verifies that conditional headers set by XML HTTP requests make it past | |
56 the host network stack. | |
57 </body> | |
58 </html> | |
OLD | NEW |