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

Unified Diff: net/base/layered_network_delegate_unittest.cc

Issue 1362793003: Notify NetworkDelegate when bytes have been sent over the network. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased on master Created 5 years, 3 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/base/layered_network_delegate.cc ('k') | net/base/network_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/layered_network_delegate_unittest.cc
diff --git a/net/base/layered_network_delegate_unittest.cc b/net/base/layered_network_delegate_unittest.cc
index a74a2b6556c1ac596518a70367e6092a1a1fcf16..bfdbe7b827b4d056d624a8a3780a2b9ae242c09f 100644
--- a/net/base/layered_network_delegate_unittest.cc
+++ b/net/base/layered_network_delegate_unittest.cc
@@ -98,6 +98,11 @@ class TestNetworkDelegateImpl : public NetworkDelegateImpl {
IncrementAndCompareCounter("on_network_bytes_received_count");
}
+ void OnNetworkBytesSent(const URLRequest& request,
+ int64_t bytes_sent) override {
+ IncrementAndCompareCounter("on_network_bytes_sent_count");
+ }
+
void OnCompleted(URLRequest* request, bool started) override {
IncrementAndCompareCounter("on_completed_count");
}
@@ -197,6 +202,7 @@ class TestLayeredNetworkDelegate : public LayeredNetworkDelegate {
request_headers.get()));
OnBeforeSendProxyHeaders(NULL, ProxyInfo(), request_headers.get());
OnSendHeaders(NULL, *request_headers);
+ OnNetworkBytesSent(*request, 42);
EXPECT_EQ(OK, OnHeadersReceived(NULL, completion_callback.callback(),
response_headers.get(), NULL, NULL));
OnResponseStarted(request.get());
@@ -284,6 +290,12 @@ class TestLayeredNetworkDelegate : public LayeredNetworkDelegate {
EXPECT_EQ(1, (*counters_)["on_network_bytes_received_count"]);
}
+ void OnNetworkBytesSentInternal(const URLRequest& request,
+ int64_t bytes_sent) override {
+ ++(*counters_)["on_network_bytes_sent_count"];
+ EXPECT_EQ(1, (*counters_)["on_network_bytes_sent_count"]);
+ }
+
void OnCompletedInternal(URLRequest* request, bool started) override {
++(*counters_)["on_completed_count"];
EXPECT_EQ(1, (*counters_)["on_completed_count"]);
« no previous file with comments | « net/base/layered_network_delegate.cc ('k') | net/base/network_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698