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

Unified Diff: net/tools/quic/test_tools/quic_test_client.h

Issue 2242143004: chromium relnote: Making QuicTestClient reads mockable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@130113504
Patch Set: Created 4 years, 4 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 | net/tools/quic/test_tools/quic_test_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/test_tools/quic_test_client.h
diff --git a/net/tools/quic/test_tools/quic_test_client.h b/net/tools/quic/test_tools/quic_test_client.h
index 3ebeb2d96bbb7ea9814f32b70bf917e75d5f3430..40fd2bf5b04e101b1c5f4e8a855d5a57ee4edde1 100644
--- a/net/tools/quic/test_tools/quic_test_client.h
+++ b/net/tools/quic/test_tools/quic_test_client.h
@@ -23,6 +23,7 @@
#include "net/tools/epoll_server/epoll_server.h"
#include "net/tools/quic/quic_client.h"
#include "net/tools/quic/test_tools/simple_client.h"
+#include "testing/gmock/include/gmock/gmock.h"
using base::StringPiece;
@@ -38,7 +39,7 @@ namespace test {
class HTTPMessage;
class MockableQuicClient;
-// A quic client which allows mocking out writes.
+// A quic client which allows mocking out reads and writes.
class MockableQuicClient : public QuicClient {
public:
MockableQuicClient(IPEndPoint server_address,
@@ -60,6 +61,16 @@ class MockableQuicClient : public QuicClient {
std::unique_ptr<ProofVerifier> proof_verifier);
~MockableQuicClient() override;
+
+ // By default, this will call QuicClient::ProcessPacket
+ MOCK_METHOD3(ProcessPacket,
+ void(const IPEndPoint&,
+ const IPEndPoint&,
+ const QuicReceivedPacket&));
+
+ void ProcessPacketBase(const IPEndPoint& self_address,
+ const IPEndPoint& peer_address,
+ const QuicReceivedPacket& packet);
QuicPacketWriter* CreateQuicPacketWriter() override;
QuicConnectionId GenerateNewConnectionId() override;
void UseWriter(QuicPacketWriterWrapper* writer);
« no previous file with comments | « no previous file | net/tools/quic/test_tools/quic_test_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698