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

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

Issue 1548783002: Adding details to most quic connection close calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110540464
Patch Set: Created 4 years, 12 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_crypto_stream.cc ('k') | net/quic/quic_flow_controller.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_crypto_stream.h" 5 #include "net/quic/quic_crypto_stream.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 TEST_F(QuicCryptoStreamTest, ProcessBadData) { 92 TEST_F(QuicCryptoStreamTest, ProcessBadData) {
93 string bad(message_data_->data(), message_data_->length()); 93 string bad(message_data_->data(), message_data_->length());
94 const int kFirstTagIndex = sizeof(uint32) + // message tag 94 const int kFirstTagIndex = sizeof(uint32) + // message tag
95 sizeof(uint16) + // number of tag-value pairs 95 sizeof(uint16) + // number of tag-value pairs
96 sizeof(uint16); // padding 96 sizeof(uint16); // padding
97 EXPECT_EQ(1, bad[kFirstTagIndex]); 97 EXPECT_EQ(1, bad[kFirstTagIndex]);
98 bad[kFirstTagIndex] = 0x7F; // out of order tag 98 bad[kFirstTagIndex] = 0x7F; // out of order tag
99 99
100 EXPECT_CALL(*connection_, 100 EXPECT_CALL(*connection_, SendConnectionCloseWithDetails(
101 SendConnectionClose(QUIC_CRYPTO_TAGS_OUT_OF_ORDER)); 101 QUIC_CRYPTO_TAGS_OUT_OF_ORDER, testing::_));
102 stream_.OnStreamFrame( 102 stream_.OnStreamFrame(
103 QuicStreamFrame(kCryptoStreamId, /*fin=*/false, /*offset=*/0, bad)); 103 QuicStreamFrame(kCryptoStreamId, /*fin=*/false, /*offset=*/0, bad));
104 } 104 }
105 105
106 TEST_F(QuicCryptoStreamTest, NoConnectionLevelFlowControl) { 106 TEST_F(QuicCryptoStreamTest, NoConnectionLevelFlowControl) {
107 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl( 107 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl(
108 &stream_)); 108 &stream_));
109 } 109 }
110 110
111 } // namespace 111 } // namespace
112 } // namespace test 112 } // namespace test
113 } // namespace net 113 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_crypto_stream.cc ('k') | net/quic/quic_flow_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698