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

Side by Side Diff: net/quic/core/crypto/crypto_framer_test.cc

Issue 2848203002: Add a platform implementation of QuicTest and QuicTestWithParam (Closed)
Patch Set: net/quic/platform/impl/quic_test_impl.cc Created 3 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
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 #include "net/quic/core/crypto/crypto_framer.h" 5 #include "net/quic/core/crypto/crypto_framer.h"
6 6
7 #include <map> 7 #include <map>
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "net/quic/core/crypto/crypto_handshake.h" 11 #include "net/quic/core/crypto/crypto_handshake.h"
12 #include "net/quic/core/crypto/crypto_protocol.h" 12 #include "net/quic/core/crypto/crypto_protocol.h"
13 #include "net/quic/core/quic_packets.h" 13 #include "net/quic/core/quic_packets.h"
14 #include "net/quic/platform/api/quic_logging.h" 14 #include "net/quic/platform/api/quic_logging.h"
15 #include "net/quic/platform/api/quic_test.h"
15 #include "net/quic/test_tools/crypto_test_utils.h" 16 #include "net/quic/test_tools/crypto_test_utils.h"
16 #include "net/quic/test_tools/quic_test_utils.h" 17 #include "net/quic/test_tools/quic_test_utils.h"
17 18
18 using std::string; 19 using std::string;
19 20
20 namespace net { 21 namespace net {
21 namespace test { 22 namespace test {
22 namespace { 23 namespace {
23 24
24 char* AsChars(unsigned char* data) { 25 char* AsChars(unsigned char* data) {
25 return reinterpret_cast<char*>(data); 26 return reinterpret_cast<char*>(data);
26 } 27 }
27 28
28 class CryptoFramerTest : public ::testing::TestWithParam<Perspective> {}; 29 class CryptoFramerTest : public QuicTestWithParam<Perspective> {};
29 30
30 class TestCryptoVisitor : public CryptoFramerVisitorInterface { 31 class TestCryptoVisitor : public CryptoFramerVisitorInterface {
31 public: 32 public:
32 TestCryptoVisitor() : error_count_(0) {} 33 TestCryptoVisitor() : error_count_(0) {}
33 34
34 void OnError(CryptoFramer* framer) override { 35 void OnError(CryptoFramer* framer) override {
35 QUIC_DLOG(ERROR) << "CryptoFramer Error: " << framer->error(); 36 QUIC_DLOG(ERROR) << "CryptoFramer Error: " << framer->error();
36 ++error_count_; 37 ++error_count_;
37 } 38 }
38 39
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 }; 465 };
465 466
466 EXPECT_TRUE(framer.ProcessInput( 467 EXPECT_TRUE(framer.ProcessInput(
467 QuicStringPiece(AsChars(input), arraysize(input)), GetParam())); 468 QuicStringPiece(AsChars(input), arraysize(input)), GetParam()));
468 EXPECT_EQ(0, visitor.error_count_); 469 EXPECT_EQ(0, visitor.error_count_);
469 } 470 }
470 471
471 } // namespace 472 } // namespace
472 } // namespace test 473 } // namespace test
473 } // namespace net 474 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/crypto/common_cert_set_test.cc ('k') | net/quic/core/crypto/crypto_handshake_message_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698