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

Side by Side Diff: net/quic/quic_framer_test.cc

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 10 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
« no previous file with comments | « net/quic/quic_fec_group_test.cc ('k') | net/quic/quic_http_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/quic_framer.h" 5 #include "net/quic/quic_framer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 QuicPacketSequenceNumber sequence_number_; 134 QuicPacketSequenceNumber sequence_number_;
135 string associated_data_; 135 string associated_data_;
136 string plaintext_; 136 string plaintext_;
137 }; 137 };
138 138
139 class TestDecrypter : public QuicDecrypter { 139 class TestDecrypter : public QuicDecrypter {
140 public: 140 public:
141 ~TestDecrypter() override {} 141 ~TestDecrypter() override {}
142 bool SetKey(StringPiece key) override { return true; } 142 bool SetKey(StringPiece key) override { return true; }
143 bool SetNoncePrefix(StringPiece nonce_prefix) override { return true; } 143 bool SetNoncePrefix(StringPiece nonce_prefix) override { return true; }
144 bool Decrypt(StringPiece nonce,
145 StringPiece associated_data,
146 StringPiece ciphertext,
147 unsigned char* output,
148 size_t* output_length) override {
149 CHECK(false) << "Not implemented";
150 return false;
151 }
152 QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number, 144 QuicData* DecryptPacket(QuicPacketSequenceNumber sequence_number,
153 StringPiece associated_data, 145 StringPiece associated_data,
154 StringPiece ciphertext) override { 146 StringPiece ciphertext) override {
155 sequence_number_ = sequence_number; 147 sequence_number_ = sequence_number;
156 associated_data_ = associated_data.as_string(); 148 associated_data_ = associated_data.as_string();
157 ciphertext_ = ciphertext.as_string(); 149 ciphertext_ = ciphertext.as_string();
158 return new QuicData(ciphertext.data(), ciphertext.length()); 150 return new QuicData(ciphertext.data(), ciphertext.length());
159 } 151 }
160 StringPiece GetKey() const override { return StringPiece(); } 152 StringPiece GetKey() const override { return StringPiece(); }
161 StringPiece GetNoncePrefix() const override { return StringPiece(); } 153 StringPiece GetNoncePrefix() const override { return StringPiece(); }
(...skipping 4083 matching lines...) Expand 10 before | Expand all | Expand 10 after
4245 EXPECT_CALL(visitor, OnPacketComplete()); 4237 EXPECT_CALL(visitor, OnPacketComplete());
4246 EXPECT_CALL(visitor, OnUnauthenticatedPublicHeader(_)).WillOnce(Return(true)); 4238 EXPECT_CALL(visitor, OnUnauthenticatedPublicHeader(_)).WillOnce(Return(true));
4247 4239
4248 QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false); 4240 QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false);
4249 EXPECT_TRUE(framer_.ProcessPacket(encrypted)); 4241 EXPECT_TRUE(framer_.ProcessPacket(encrypted));
4250 EXPECT_EQ(QUIC_NO_ERROR, framer_.error()); 4242 EXPECT_EQ(QUIC_NO_ERROR, framer_.error());
4251 } 4243 }
4252 4244
4253 } // namespace test 4245 } // namespace test
4254 } // namespace net 4246 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_fec_group_test.cc ('k') | net/quic/quic_http_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698