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

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

Issue 11364068: Add a QuicHttpStream class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix bugs Created 8 years 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 | Annotate | Revision Log
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_reliable_client_stream.h" 5 #include "net/quic/quic_reliable_client_stream.h"
6 6
7 #include "net/base/net_errors.h" 7 #include "net/base/net_errors.h"
8 #include "net/quic/quic_client_session.h" 8 #include "net/quic/quic_client_session.h"
9 #include "net/quic/quic_utils.h" 9 #include "net/quic/quic_utils.h"
10 #include "net/quic/test_tools/quic_test_utils.h" 10 #include "net/quic/test_tools/quic_test_utils.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 TEST_F(QuicReliableClientStreamTest, TerminateFromPeer) { 46 TEST_F(QuicReliableClientStreamTest, TerminateFromPeer) {
47 EXPECT_CALL(delegate_, OnClose(QUIC_NO_ERROR)); 47 EXPECT_CALL(delegate_, OnClose(QUIC_NO_ERROR));
48 48
49 stream_.TerminateFromPeer(true); 49 stream_.TerminateFromPeer(true);
50 } 50 }
51 51
52 TEST_F(QuicReliableClientStreamTest, ProcessData) { 52 TEST_F(QuicReliableClientStreamTest, ProcessData) {
53 const char data[] = "hello world!"; 53 const char data[] = "hello world!";
54 EXPECT_CALL(delegate_, OnDataReceived(StrEq(data), arraysize(data))); 54 EXPECT_CALL(delegate_, OnDataReceived(StrEq(data), arraysize(data)));
55 EXPECT_CALL(delegate_, OnClose(QUIC_NO_ERROR));
55 56
56 EXPECT_EQ(arraysize(data), stream_.ProcessData(data, arraysize(data))); 57 EXPECT_EQ(arraysize(data), stream_.ProcessData(data, arraysize(data)));
57 } 58 }
58 59
59 TEST_F(QuicReliableClientStreamTest, ProcessDataWithError) { 60 TEST_F(QuicReliableClientStreamTest, ProcessDataWithError) {
60 const char data[] = "hello world!"; 61 const char data[] = "hello world!";
61 EXPECT_CALL(delegate_, 62 EXPECT_CALL(delegate_,
62 OnDataReceived(StrEq(data), 63 OnDataReceived(StrEq(data),
63 arraysize(data))).WillOnce(Return(ERR_UNEXPECTED)); 64 arraysize(data))).WillOnce(Return(ERR_UNEXPECTED));
65 EXPECT_CALL(delegate_, OnClose(QUIC_BAD_APPLICATION_PAYLOAD));
66
64 67
65 EXPECT_EQ(0u, stream_.ProcessData(data, arraysize(data))); 68 EXPECT_EQ(0u, stream_.ProcessData(data, arraysize(data)));
66 } 69 }
67 70
68 } // namespace 71 } // namespace
69 } // namespace test 72 } // namespace test
70 } // namespace net 73 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698