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

Side by Side Diff: trunk/src/net/quic/test_tools/quic_test_utils.h

Issue 15018013: Revert 198736 "Land Recent QUIC changes" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Common utilities for Quic tests 5 // Common utilities for Quic tests
6 6
7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_
8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "net/quic/congestion_control/send_algorithm_interface.h" 12 #include "net/quic/congestion_control/send_algorithm_interface.h"
13 #include "net/quic/quic_connection.h" 13 #include "net/quic/quic_connection.h"
14 #include "net/quic/quic_framer.h" 14 #include "net/quic/quic_framer.h"
15 #include "net/quic/quic_session.h" 15 #include "net/quic/quic_session.h"
16 #include "net/quic/quic_spdy_decompressor.h"
17 #include "net/quic/test_tools/mock_clock.h" 16 #include "net/quic/test_tools/mock_clock.h"
18 #include "net/quic/test_tools/mock_random.h" 17 #include "net/quic/test_tools/mock_random.h"
19 #include "net/spdy/spdy_framer.h"
20 #include "testing/gmock/include/gmock/gmock.h" 18 #include "testing/gmock/include/gmock/gmock.h"
21 19
22 namespace net { 20 namespace net {
23 21
24 namespace test { 22 namespace test {
25 23
26 void CompareCharArraysWithHexError(const std::string& description, 24 void CompareCharArraysWithHexError(const std::string& description,
27 const char* actual, 25 const char* actual,
28 const int actual_len, 26 const int actual_len,
29 const char* expected, 27 const char* expected,
30 const int expected_len); 28 const int expected_len);
31 29
32 void CompareQuicDataWithHexError(const std::string& description, 30 void CompareQuicDataWithHexError(const std::string& description,
33 QuicData* actual, 31 QuicData* actual,
34 QuicData* expected); 32 QuicData* expected);
35 33
36 // Returns the length of the QuicPacket that will be created if it contains 34 // Returns the length of the QuicPacket that will be created if it contains
37 // a stream frame that has |payload| bytes. 35 // a stream frame that has |payload| bytes.
38 size_t GetPacketLengthForOneStream(bool include_version, size_t payload); 36 size_t GetPacketLengthForOneStream(bool include_version, size_t payload);
39 37
40 string SerializeUncompressedHeaders(const SpdyHeaderBlock& headers);
41
42 class MockFramerVisitor : public QuicFramerVisitorInterface { 38 class MockFramerVisitor : public QuicFramerVisitorInterface {
43 public: 39 public:
44 MockFramerVisitor(); 40 MockFramerVisitor();
45 ~MockFramerVisitor(); 41 ~MockFramerVisitor();
46 42
47 MOCK_METHOD1(OnError, void(QuicFramer* framer)); 43 MOCK_METHOD1(OnError, void(QuicFramer* framer));
48 // The constructor sets this up to return false by default. 44 // The constructor sets this up to return false by default.
49 MOCK_METHOD1(OnProtocolVersionMismatch, bool(QuicVersionTag version)); 45 MOCK_METHOD1(OnProtocolVersionMismatch, bool(QuicVersionTag version));
50 MOCK_METHOD0(OnPacket, void()); 46 MOCK_METHOD0(OnPacket, void());
51 MOCK_METHOD1(OnPublicResetPacket, void(const QuicPublicResetPacket& header)); 47 MOCK_METHOD1(OnPublicResetPacket, void(const QuicPublicResetPacket& header));
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 class TestEntropyCalculator : 315 class TestEntropyCalculator :
320 public QuicReceivedEntropyHashCalculatorInterface { 316 public QuicReceivedEntropyHashCalculatorInterface {
321 public: 317 public:
322 TestEntropyCalculator() { } 318 TestEntropyCalculator() { }
323 virtual ~TestEntropyCalculator() { } 319 virtual ~TestEntropyCalculator() { }
324 320
325 virtual QuicPacketEntropyHash ReceivedEntropyHash( 321 virtual QuicPacketEntropyHash ReceivedEntropyHash(
326 QuicPacketSequenceNumber sequence_number) const OVERRIDE; 322 QuicPacketSequenceNumber sequence_number) const OVERRIDE;
327 }; 323 };
328 324
329 class TestDecompressorVisitor : public QuicSpdyDecompressor::Visitor { 325 } // namespace test
330 public:
331 virtual ~TestDecompressorVisitor() {}
332 virtual bool OnDecompressedData(base::StringPiece data) OVERRIDE;
333 326
334 string data() { return data_; }
335
336 private:
337 string data_;
338 };
339
340 } // namespace test
341 } // namespace net 327 } // namespace net
342 328
343 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ 329 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « trunk/src/net/quic/test_tools/crypto_test_utils.cc ('k') | trunk/src/net/quic/test_tools/quic_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698