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

Unified Diff: net/http/http_proxy_client_socket_pool_unittest.cc

Issue 2768173002: Record the time duration for establishing proxy connection (Closed)
Patch Set: Created 3 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
Index: net/http/http_proxy_client_socket_pool_unittest.cc
diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc
index d782c70349318f007e8c05c786e98548ae598fd2..bbb74a9ee978a2f37dbc0684d4f444ae1b14f28e 100644
--- a/net/http/http_proxy_client_socket_pool_unittest.cc
+++ b/net/http/http_proxy_client_socket_pool_unittest.cc
@@ -10,6 +10,7 @@
#include "base/compiler_specific.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/histogram_tester.h"
#include "net/base/net_errors.h"
#include "net/base/proxy_delegate.h"
#include "net/base/test_completion_callback.h"
@@ -191,6 +192,8 @@ class HttpProxyClientSocketPoolTest
return transport_socket_pool_.last_request_priority();
}
+ const base::HistogramTester& histogram_tester() { return histogram_tester_; }
+
private:
SpdySessionDependencies session_deps_;
@@ -201,6 +204,8 @@ class HttpProxyClientSocketPoolTest
std::unique_ptr<HttpNetworkSession> session_;
+ base::HistogramTester histogram_tester_;
+
protected:
SpdyTestUtil spdy_util_;
std::unique_ptr<SSLSocketDataProvider> ssl_data_;
@@ -230,6 +235,12 @@ TEST_P(HttpProxyClientSocketPoolTest, NoTunnel) {
EXPECT_FALSE(proxy_delegate->on_before_tunnel_request_called());
EXPECT_FALSE(proxy_delegate->on_tunnel_headers_received_called());
EXPECT_TRUE(proxy_delegate->on_tunnel_request_completed_called());
+
+ bool is_secure_proxy = GetParam() == HTTPS || GetParam() == SPDY;
+ histogram_tester().ExpectTotalCount(
+ "Net.Proxy.ConnectLatency.Insecure.Success", is_secure_proxy ? 0 : 1);
+ histogram_tester().ExpectTotalCount("Net.Proxy.ConnectLatency.Secure.Success",
+ is_secure_proxy ? 1 : 0);
}
// Make sure that HttpProxyConnectJob passes on its priority to its
« no previous file with comments | « no previous file | net/http/http_proxy_client_socket_wrapper.h » ('j') | net/http/http_proxy_client_socket_wrapper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698