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

Unified Diff: net/nqe/network_quality_estimator_unittest.cc

Issue 2486033002: NQE: Use ResponseHeaders to get the HTTP status code (Closed)
Patch Set: cleanup Created 4 years, 1 month 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/nqe/network_quality_estimator_test_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/network_quality_estimator_unittest.cc
diff --git a/net/nqe/network_quality_estimator_unittest.cc b/net/nqe/network_quality_estimator_unittest.cc
index a568bc91cea417fafe3c8d95240a1d2692ea2912..bda59f09c1a716b02115d3206a8e583d4c0bcc53 100644
--- a/net/nqe/network_quality_estimator_unittest.cc
+++ b/net/nqe/network_quality_estimator_unittest.cc
@@ -26,6 +26,8 @@
#include "build/build_config.h"
#include "net/base/load_flags.h"
#include "net/base/network_change_notifier.h"
+#include "net/http/http_response_headers.h"
+#include "net/http/http_response_info.h"
#include "net/http/http_status_code.h"
#include "net/nqe/effective_connection_type.h"
#include "net/nqe/external_estimate_provider.h"
@@ -2185,6 +2187,20 @@ TEST(NetworkQualityEstimatorTest, CorrelationHistogram) {
// Get the bits at index 25-31 which contain the resource load size.
EXPECT_LE(0, (buckets.at(0).min) % 128);
+
+ // Start another main-frame request which is redirected to an HTTPS URL.
+ // Redirection should not cause any crashes.
+ std::unique_ptr<URLRequest> request_3(context.CreateRequest(
+ estimator.GetRedirectURL(), DEFAULT_PRIORITY, &test_delegate));
+ request_3->Start();
+ base::RunLoop().Run();
+ EXPECT_FALSE(request_3->original_url().SchemeIsCryptographic());
+ EXPECT_TRUE(request_3->url().SchemeIsCryptographic());
+ EXPECT_TRUE(!request_3->response_info().headers.get() ||
+ request_3->response_info().headers->response_code() != HTTP_OK);
+ // Correlation metric should not be logged for redirected requests.
+ histogram_tester.ExpectTotalCount(
+ "NQE.Correlation.ResourceLoadTime.0Kb_128Kb", 1);
}
}
« no previous file with comments | « net/nqe/network_quality_estimator_test_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698