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

Unified Diff: net/quic/quic_packet_creator_test.cc

Issue 1009543004: Create a Perspective enum to use instead of a bool is_server to improve (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NET_EXPORT_PRIVATE to fix compiler error Created 5 years, 9 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/quic/quic_packet_creator.cc ('k') | net/quic/quic_packet_generator_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_creator_test.cc
diff --git a/net/quic/quic_packet_creator_test.cc b/net/quic/quic_packet_creator_test.cc
index 877ccc85d97b0e41e1641d540d1f907b0d381f9d..75a867633d496d09b57457dbae2ec47a42d9481b 100644
--- a/net/quic/quic_packet_creator_test.cc
+++ b/net/quic/quic_packet_creator_test.cc
@@ -73,10 +73,12 @@ vector<TestParams> GetTestParams() {
class QuicPacketCreatorTest : public ::testing::TestWithParam<TestParams> {
protected:
QuicPacketCreatorTest()
- : server_framer_(SupportedVersions(GetParam().version), QuicTime::Zero(),
- true),
- client_framer_(SupportedVersions(GetParam().version), QuicTime::Zero(),
- false),
+ : server_framer_(SupportedVersions(GetParam().version),
+ QuicTime::Zero(),
+ Perspective::IS_SERVER),
+ client_framer_(SupportedVersions(GetParam().version),
+ QuicTime::Zero(),
+ Perspective::IS_CLIENT),
connection_id_(2),
data_("foo"),
creator_(connection_id_, &client_framer_, &mock_random_) {
@@ -779,7 +781,7 @@ TEST_P(QuicPacketCreatorTest, NonCryptoStreamFramePacketNonPadding) {
}
TEST_P(QuicPacketCreatorTest, SerializeVersionNegotiationPacket) {
- QuicFramerPeer::SetIsServer(&client_framer_, true);
+ QuicFramerPeer::SetPerspective(&client_framer_, Perspective::IS_SERVER);
QuicVersionVector versions;
versions.push_back(test::QuicVersionMax());
scoped_ptr<QuicEncryptedPacket> encrypted(
@@ -791,7 +793,7 @@ TEST_P(QuicPacketCreatorTest, SerializeVersionNegotiationPacket) {
EXPECT_CALL(framer_visitor_, OnUnauthenticatedPublicHeader(_));
EXPECT_CALL(framer_visitor_, OnVersionNegotiationPacket(_));
}
- QuicFramerPeer::SetIsServer(&client_framer_, false);
+ QuicFramerPeer::SetPerspective(&client_framer_, Perspective::IS_CLIENT);
client_framer_.ProcessPacket(*encrypted);
}
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/quic_packet_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698