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

Unified Diff: net/quic/quic_crypto_stream_test.cc

Issue 11633030: Send the ClientHello handshake message. Fix a bug in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove an extraneous test:: before TestCryptoVisitor Created 7 years, 11 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_crypto_client_stream_test.cc ('k') | net/quic/quic_stream_factory_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_crypto_stream_test.cc
===================================================================
--- net/quic/quic_crypto_stream_test.cc (revision 177030)
+++ net/quic/quic_crypto_stream_test.cc (working copy)
@@ -4,16 +4,17 @@
#include "net/quic/quic_crypto_stream.h"
-#include <map>
#include <string>
+#include <vector>
+#include "base/memory/scoped_ptr.h"
#include "net/quic/quic_utils.h"
#include "net/quic/test_tools/quic_test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-using std::map;
using std::string;
+using std::vector;
namespace net {
namespace test {
@@ -26,26 +27,15 @@
}
void OnHandshakeMessage(const CryptoHandshakeMessage& message) {
- message_tags_.push_back(message.tag);
- message_maps_.push_back(map<CryptoTag, string>());
- CryptoTagValueMap::const_iterator it = message.tag_value_map.begin();
- while (it != message.tag_value_map.end()) {
- message_maps_.back()[it->first] = it->second.as_string();
- ++it;
- }
+ messages_.push_back(message);
}
- std::vector<CryptoTag>* message_tags() {
- return &message_tags_;
+ vector<CryptoHandshakeMessage>* messages() {
+ return &messages_;
}
- std::vector<std::map<CryptoTag, string> >* message_maps() {
- return &message_maps_;
- }
-
private:
- std::vector<CryptoTag> message_tags_;
- std::vector<std::map<CryptoTag, string> > message_maps_;
+ vector<CryptoHandshakeMessage> messages_;
DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoStream);
};
@@ -94,11 +84,11 @@
EXPECT_EQ(message_data_->length(),
stream_.ProcessData(message_data_->data(),
message_data_->length()));
- ASSERT_EQ(1u, stream_.message_tags()->size());
- EXPECT_EQ(kSHLO, (*stream_.message_tags())[0]);
- EXPECT_EQ(2u, (*stream_.message_maps())[0].size());
- EXPECT_EQ("abc", (*stream_.message_maps())[0][1]);
- EXPECT_EQ("def", (*stream_.message_maps())[0][2]);
+ ASSERT_EQ(1u, stream_.messages()->size());
+ EXPECT_EQ(kSHLO, (*stream_.messages())[0].tag);
+ EXPECT_EQ(2u, (*stream_.messages())[0].tag_value_map.size());
+ EXPECT_EQ("abc", (*stream_.messages())[0].tag_value_map[1]);
+ EXPECT_EQ("def", (*stream_.messages())[0].tag_value_map[2]);
}
TEST_F(QuicCryptoStreamTest, ProcessBadData) {
« no previous file with comments | « net/quic/quic_crypto_client_stream_test.cc ('k') | net/quic/quic_stream_factory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698