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

Side by Side Diff: net/tools/quic/quic_spdy_server_stream_base_test.cc

Issue 2856243003: Revert of Landing Recent QUIC changes until Sat Apr 29 00:22:04 2017 +0000 (Closed)
Patch Set: Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/tools/quic/quic_spdy_server_stream_base.h" 5 #include "net/tools/quic/quic_spdy_server_stream_base.h"
6 6
7 #include "net/quic/platform/api/quic_ptr_util.h" 7 #include "net/quic/platform/api/quic_ptr_util.h"
8 #include "net/quic/platform/api/quic_test.h" 8 #include "net/quic/platform/api/quic_test.h"
9 #include "net/quic/test_tools/quic_spdy_session_peer.h"
10 #include "net/quic/test_tools/quic_test_utils.h" 9 #include "net/quic/test_tools/quic_test_utils.h"
11 10
12 using testing::_; 11 using testing::_;
13 12
14 namespace net { 13 namespace net {
15 namespace test { 14 namespace test {
16 namespace { 15 namespace {
17 16
18 class TestQuicSpdyServerStream : public QuicSpdyServerStreamBase { 17 class TestQuicSpdyServerStream : public QuicSpdyServerStreamBase {
19 public: 18 public:
20 TestQuicSpdyServerStream(QuicStreamId id, QuicSpdySession* session) 19 TestQuicSpdyServerStream(QuicStreamId id, QuicSpdySession* session)
21 : QuicSpdyServerStreamBase(id, session) {} 20 : QuicSpdyServerStreamBase(id, session) {}
22 21
23 void OnDataAvailable() override {} 22 void OnDataAvailable() override {}
24 }; 23 };
25 24
26 class QuicSpdyServerStreamBaseTest : public QuicTest { 25 class QuicSpdyServerStreamBaseTest : public QuicTest {
27 protected: 26 protected:
28 QuicSpdyServerStreamBaseTest() 27 QuicSpdyServerStreamBaseTest()
29 : session_(new MockQuicConnection(&helper_, 28 : session_(new MockQuicConnection(&helper_,
30 &alarm_factory_, 29 &alarm_factory_,
31 Perspective::IS_SERVER)) { 30 Perspective::IS_SERVER)) {
32 stream_ = new TestQuicSpdyServerStream( 31 stream_ = new TestQuicSpdyServerStream(kClientDataStreamId1, &session_);
33 QuicSpdySessionPeer::GetNthClientInitiatedStreamId(session_, 0),
34 &session_);
35 session_.ActivateStream(QuicWrapUnique(stream_)); 32 session_.ActivateStream(QuicWrapUnique(stream_));
36 } 33 }
37 34
38 QuicSpdyServerStreamBase* stream_ = nullptr; 35 QuicSpdyServerStreamBase* stream_ = nullptr;
39 MockQuicConnectionHelper helper_; 36 MockQuicConnectionHelper helper_;
40 MockAlarmFactory alarm_factory_; 37 MockAlarmFactory alarm_factory_;
41 MockQuicSpdySession session_; 38 MockQuicSpdySession session_;
42 }; 39 };
43 40
44 TEST_F(QuicSpdyServerStreamBaseTest, 41 TEST_F(QuicSpdyServerStreamBaseTest,
(...skipping 13 matching lines...) Expand all
58 QuicRstStreamFrame rst_frame(stream_->id(), QUIC_STREAM_CANCELLED, 1234); 55 QuicRstStreamFrame rst_frame(stream_->id(), QUIC_STREAM_CANCELLED, 1234);
59 stream_->OnStreamReset(rst_frame); 56 stream_->OnStreamReset(rst_frame);
60 57
61 EXPECT_TRUE(stream_->reading_stopped()); 58 EXPECT_TRUE(stream_->reading_stopped());
62 EXPECT_TRUE(stream_->write_side_closed()); 59 EXPECT_TRUE(stream_->write_side_closed());
63 } 60 }
64 61
65 } // namespace 62 } // namespace
66 } // namespace test 63 } // namespace test
67 } // namespace net 64 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_spdy_client_stream_test.cc ('k') | net/tools/quic/test_tools/quic_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698