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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 16901013: Expose receive header end time for URLRequestRedirectJob (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: set send_start and send_end Created 7 years, 6 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 | « net/url_request/url_request_redirect_job.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index aae296ff25504aeb8077ccee6aac233b2ec21526..b02fd3723f10a3b1196a96b773b7d7c6916b253a 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -175,6 +175,24 @@ void TestLoadTimingCacheHitNoNetwork(
EXPECT_TRUE(load_timing_info.proxy_resolve_end.is_null());
}
+// Tests load timing information in the case of a HSTS redirect occurred.
+void TestLoadTimingHSTSRedirectOccured(
+ const net::LoadTimingInfo& load_timing_info) {
+ EXPECT_FALSE(load_timing_info.socket_reused);
+ EXPECT_EQ(net::NetLog::Source::kInvalidId, load_timing_info.socket_log_id);
+
+ EXPECT_FALSE(load_timing_info.request_start_time.is_null());
+ EXPECT_FALSE(load_timing_info.request_start.is_null());
+
+ ExpectConnectTimingHasNoTimes(load_timing_info.connect_timing);
+ EXPECT_TRUE(load_timing_info.proxy_resolve_start.is_null());
+ EXPECT_TRUE(load_timing_info.proxy_resolve_end.is_null());
+ EXPECT_EQ(load_timing_info.send_start, load_timing_info.receive_headers_end);
+ EXPECT_EQ(load_timing_info.send_end, load_timing_info.receive_headers_end);
+
+ EXPECT_FALSE(load_timing_info.receive_headers_end.is_null());
mmenke 2013/06/26 19:55:40 This is basically equivalent to TestLoadTimingCach
+}
+
// Tests load timing in the case that there is no HTTP response. This can be
// used to test in the case of errors or non-HTTP requests.
void TestLoadTimingNoHttpResponse(
@@ -4904,6 +4922,10 @@ TEST_F(HTTPSRequestTest, HSTSPreservesPosts) {
EXPECT_EQ("https", req.url().scheme());
EXPECT_EQ("POST", req.method());
EXPECT_EQ(kData, d.data_received());
+
+ LoadTimingInfo load_timing_info;
+ network_delegate.GetLoadTimingInfoBeforeRedirect(&load_timing_info);
+ TestLoadTimingHSTSRedirectOccured(load_timing_info);
}
TEST_F(HTTPSRequestTest, SSLv3Fallback) {
« no previous file with comments | « net/url_request/url_request_redirect_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698