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