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

Side by Side Diff: remoting/protocol/connection_to_client_unittest.cc

Issue 580243003: Cleanup Fake* classes in remoting/protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sctp
Patch Set: Created 6 years, 3 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) 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 "remoting/protocol/connection_to_client.h" 5 #include "remoting/protocol/connection_to_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 }; 62 };
63 63
64 TEST_F(ConnectionToClientTest, SendUpdateStream) { 64 TEST_F(ConnectionToClientTest, SendUpdateStream) {
65 scoped_ptr<VideoPacket> packet(new VideoPacket()); 65 scoped_ptr<VideoPacket> packet(new VideoPacket());
66 viewer_->video_stub()->ProcessVideoPacket(packet.Pass(), base::Closure()); 66 viewer_->video_stub()->ProcessVideoPacket(packet.Pass(), base::Closure());
67 67
68 base::RunLoop().RunUntilIdle(); 68 base::RunLoop().RunUntilIdle();
69 69
70 // Verify that something has been written. 70 // Verify that something has been written.
71 // TODO(sergeyu): Verify that the correct data has been written. 71 // TODO(sergeyu): Verify that the correct data has been written.
72 ASSERT_TRUE(session_->GetStreamChannel(kVideoChannelName)); 72 ASSERT_TRUE(session_->fake_channel_factory().GetChannel(kVideoChannelName));
73 EXPECT_GT(session_->GetStreamChannel(kVideoChannelName)-> 73 EXPECT_GT(session_->fake_channel_factory().GetChannel(kVideoChannelName)->
74 written_data().size(), 0u); 74 written_data().size(), 0u);
75 75
76 // And then close the connection to ConnectionToClient. 76 // And then close the connection to ConnectionToClient.
77 viewer_->Disconnect(); 77 viewer_->Disconnect();
78 78
79 base::RunLoop().RunUntilIdle(); 79 base::RunLoop().RunUntilIdle();
80 } 80 }
81 81
82 TEST_F(ConnectionToClientTest, NoWriteAfterDisconnect) { 82 TEST_F(ConnectionToClientTest, NoWriteAfterDisconnect) {
83 scoped_ptr<VideoPacket> packet(new VideoPacket()); 83 scoped_ptr<VideoPacket> packet(new VideoPacket());
(...skipping 14 matching lines...) Expand all
98 base::RunLoop().RunUntilIdle(); 98 base::RunLoop().RunUntilIdle();
99 99
100 EXPECT_CALL(handler_, OnConnectionClosed(viewer_.get(), SESSION_REJECTED)); 100 EXPECT_CALL(handler_, OnConnectionClosed(viewer_.get(), SESSION_REJECTED));
101 session_->set_error(SESSION_REJECTED); 101 session_->set_error(SESSION_REJECTED);
102 session_->event_handler()->OnSessionStateChange(Session::FAILED); 102 session_->event_handler()->OnSessionStateChange(Session::FAILED);
103 base::RunLoop().RunUntilIdle(); 103 base::RunLoop().RunUntilIdle();
104 } 104 }
105 105
106 } // namespace protocol 106 } // namespace protocol
107 } // namespace remoting 107 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698