Chromium Code Reviews| Index: net/quic/quic_server_test.cc |
| diff --git a/net/tools/quic/quic_server_test.cc b/net/quic/quic_server_test.cc |
| similarity index 62% |
| copy from net/tools/quic/quic_server_test.cc |
| copy to net/quic/quic_server_test.cc |
| index e2d7c4f3288f363689eb9a47a72b32ec3cd38b5f..372fb909497027ab474af75027f0d220b0c02e62 100644 |
| --- a/net/tools/quic/quic_server_test.cc |
| +++ b/net/quic/quic_server_test.cc |
| @@ -2,27 +2,30 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "net/tools/quic/quic_server.h" |
| +#include "net/quic/quic_server.h" |
| #include "net/quic/crypto/quic_random.h" |
| #include "net/quic/quic_utils.h" |
| -#include "net/tools/quic/test_tools/mock_quic_dispatcher.h" |
| +#include "net/quic/test_tools/mock_clock.h" |
| +#include "net/quic/test_tools/mock_quic_dispatcher.h" |
| +#include "net/quic/test_tools/mock_random.h" |
| +#include "net/quic/test_tools/quic_test_utils.h" |
| +#include "net/quic/test_tools/test_task_runner.h" |
|
wtc
2014/06/18 02:04:47
We should be able to remove some of these headers.
dmziegler
2014/06/18 20:13:42
Done.
|
| #include "testing/gtest/include/gtest/gtest.h" |
| using ::testing::_; |
| namespace net { |
| -namespace tools { |
| namespace test { |
| namespace { |
| -class QuicServerDispatchPacketTest : public ::testing::Test { |
| +class QuicChromeServerDispatchPacketTest : public ::testing::Test { |
|
wtc
2014/06/18 02:04:47
Why do we need to rename this test class? Is there
dmziegler
2014/06/18 20:13:42
Yes, it conflicts with the other quic_server_test.
|
| public: |
| - QuicServerDispatchPacketTest() |
| + QuicChromeServerDispatchPacketTest() |
| : crypto_config_("blah", QuicRandom::GetInstance()), |
| - dispatcher_(config_, crypto_config_, &eps_) { |
| - dispatcher_.Initialize(1234); |
| + dispatcher_(config_, crypto_config_, &helper_) { |
| + dispatcher_.Initialize(NULL); |
| } |
| void DispatchPacket(const QuicEncryptedPacket& packet) { |
| @@ -33,11 +36,11 @@ class QuicServerDispatchPacketTest : public ::testing::Test { |
| protected: |
| QuicConfig config_; |
| QuicCryptoServerConfig crypto_config_; |
| - EpollServer eps_; |
| + MockHelper helper_; |
| MockQuicDispatcher dispatcher_; |
| }; |
| -TEST_F(QuicServerDispatchPacketTest, DispatchPacket) { |
| +TEST_F(QuicChromeServerDispatchPacketTest, DispatchPacket) { |
| unsigned char valid_packet[] = { |
| // public flags (8 byte connection_id) |
| 0x3C, |
| @@ -49,8 +52,8 @@ TEST_F(QuicServerDispatchPacketTest, DispatchPacket) { |
| 0x34, 0x12, |
| // private flags |
| 0x00 }; |
| - QuicEncryptedPacket encrypted_valid_packet(QuicUtils::AsChars(valid_packet), |
| - arraysize(valid_packet), false); |
| + QuicEncryptedPacket encrypted_valid_packet( |
| + QuicUtils::AsChars(valid_packet), arraysize(valid_packet), false); |
| EXPECT_CALL(dispatcher_, ProcessPacket(_, _, _)).Times(1); |
| DispatchPacket(encrypted_valid_packet); |
| @@ -58,5 +61,4 @@ TEST_F(QuicServerDispatchPacketTest, DispatchPacket) { |
| } // namespace |
| } // namespace test |
| -} // namespace tools |
| } // namespace net |