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

Unified Diff: chrome_frame/test/url_request_test.cc

Issue 1186002: Adding support for HEAD requests.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome_frame/urlmon_url_request.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/url_request_test.cc
===================================================================
--- chrome_frame/test/url_request_test.cc (revision 42349)
+++ chrome_frame/test/url_request_test.cc (working copy)
@@ -85,6 +85,46 @@
server.TearDown();
}
+// Same as Simple1 except we use the HEAD verb to fetch only the headers
+// from the server.
+TEST(UrlmonUrlRequestTest, Head) {
+ MockUrlDelegate mock;
+ ChromeFrameHTTPServer server;
+ chrome_frame_test::TimedMsgLoop loop;
+ win_util::ScopedCOMInitializer init_com;
+ CComObjectStackEx<UrlmonUrlRequest> request;
+
+ server.SetUp();
+ request.AddRef();
+ request.Initialize(&mock, 1, // request_id
+ server.Resolve(L"files/chrome_frame_window_open.html").spec(),
+ "head",
+ "", // referrer
+ "", // extra request
+ NULL, // upload data
+ true); // frame busting
+
+ testing::InSequence s;
+ EXPECT_CALL(mock, OnResponseStarted(1, testing::_, testing::_, testing::_,
+ testing::_, testing::_, testing::_))
+ .Times(1)
+ .WillOnce(testing::IgnoreResult(testing::InvokeWithoutArgs(CreateFunctor(
+ &request, &UrlmonUrlRequest::Read, 512))));
+
+
+ // For HEAD requests we don't expect content reads.
+ EXPECT_CALL(mock, OnReadComplete(1, testing::_, testing::_)).Times(0);
+
+ EXPECT_CALL(mock, OnResponseEnd(1, testing::_))
+ .Times(1)
+ .WillOnce(QUIT_LOOP_SOON(loop, 2));
+
+ request.Start();
+ loop.RunFor(kChromeFrameLongNavigationTimeoutInSeconds);
+ request.Release();
+ server.TearDown();
+}
+
TEST(UrlmonUrlRequestTest, UnreachableUrl) {
MockUrlDelegate mock;
chrome_frame_test::TimedMsgLoop loop;
« no previous file with comments | « no previous file | chrome_frame/urlmon_url_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698