diff options
-rw-r--r-- | chrome/browser/renderer_host/resource_dispatcher_host.cc | 3 | ||||
-rw-r--r-- | chrome_frame/test/chrome_frame_unittests.cc | 15 | ||||
-rw-r--r-- | chrome_frame/test/data/xmlhttprequest_test.html | 48 |
3 files changed, 65 insertions, 1 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc index 657e495..78656b2 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc @@ -383,7 +383,8 @@ void ResourceDispatcherHost::OnSyncLoad( int request_id, const ViewHostMsg_Resource_Request& request_data, IPC::Message* sync_result) { - BeginRequest(request_id, request_data, sync_result, 0); + BeginRequest(request_id, request_data, sync_result, + sync_result->routing_id()); } void ResourceDispatcherHost::BeginRequest( diff --git a/chrome_frame/test/chrome_frame_unittests.cc b/chrome_frame/test/chrome_frame_unittests.cc index ea7de65..9193f99 100644 --- a/chrome_frame/test/chrome_frame_unittests.cc +++ b/chrome_frame/test/chrome_frame_unittests.cc @@ -1651,3 +1651,18 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_BackForwardAnchor) { mock.Uninitialize(); chrome_frame_test::CloseAllIEWindows(); } + +const wchar_t kChromeFrameFullTabModeXMLHttpRequestTestUrl[] = + L"files/xmlhttprequest_test.html"; + +TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_ChromeFrameXHRTest) { + chrome_frame_test::TimedMsgLoop loop; + + ASSERT_TRUE(LaunchBrowser(IE, kChromeFrameFullTabModeXMLHttpRequestTestUrl)); + + loop.RunFor(kChromeFrameLongNavigationTimeoutInSeconds); + + chrome_frame_test::CloseAllIEWindows(); + ASSERT_TRUE(CheckResultFile(L"FullTab_XMLHttpRequestTest", "OK")); +} + diff --git a/chrome_frame/test/data/xmlhttprequest_test.html b/chrome_frame/test/data/xmlhttprequest_test.html new file mode 100644 index 0000000..0672779 --- /dev/null +++ b/chrome_frame/test/data/xmlhttprequest_test.html @@ -0,0 +1,48 @@ +<html> + <head> + <meta http-equiv="x-ua-compatible" content="chrome=1" /> + <title>ChromeFrame keyevent test</title> + <script type="text/javascript" + src="chrome_frame_tester_helpers.js"></script> + + <script type="text/javascript"> + function ValidateUserAgent() { + if (isRunningInMSIE()) { + onFailure("FullTab_XMLHttpRequestTest", 1, "Failed"); + } + + SendXHRRequest(); + } + + function SendXHRRequest() { + var xhr = getXHRObject(); + if (!xhr) { + onFailure("FullTab_XMLHttpRequestTest", 1, + "Failed to get XHR object"); + } + + xhr.open("GET", "http://localhost:1337/echoheader?User-Agent", false); + try { + xhr.send(null); + var pos = xhr.responseText.indexOf("chromeframe"); + if (pos >= 0) { + appendStatus("Received user agent: " + xhr.responseText); + onSuccess("FullTab_XMLHttpRequestTest", 1); + } else { + onFailure("FullTab_XMLHttpRequestTest", 1, + "Failed to find chromeframe in user agent."); + } + } catch (e) { + appendStatus("XHR send failed. Error: " + e.description); + onFailure("FullTab_XMLHttpRequestTest", 1, + "Failed to send XHR request"); + } + } + </script> + </head> + + <body onLoad="setTimeout(ValidateUserAgent, 100);" onkeypress="OnKeyPress()"> + ChromeFrame full tab mode XMLHttpRequest test. Verifies that + XMLHttpRequests use the host network stack. + </body> +</html> |