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

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, 2 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(
73 EXPECT_GT(session_->GetStreamChannel(kVideoChannelName)-> 73 session_->fake_channel_factory().GetFakeChannel(kVideoChannelName));
74 written_data().size(), 0u); 74 EXPECT_FALSE(session_->fake_channel_factory()
75 .GetFakeChannel(kVideoChannelName)->written_data().empty());
75 76
76 // And then close the connection to ConnectionToClient. 77 // And then close the connection to ConnectionToClient.
77 viewer_->Disconnect(); 78 viewer_->Disconnect();
78 79
79 base::RunLoop().RunUntilIdle(); 80 base::RunLoop().RunUntilIdle();
80 } 81 }
81 82
82 TEST_F(ConnectionToClientTest, NoWriteAfterDisconnect) { 83 TEST_F(ConnectionToClientTest, NoWriteAfterDisconnect) {
83 scoped_ptr<VideoPacket> packet(new VideoPacket()); 84 scoped_ptr<VideoPacket> packet(new VideoPacket());
84 viewer_->video_stub()->ProcessVideoPacket(packet.Pass(), base::Closure()); 85 viewer_->video_stub()->ProcessVideoPacket(packet.Pass(), base::Closure());
(...skipping 13 matching lines...) Expand all
98 base::RunLoop().RunUntilIdle(); 99 base::RunLoop().RunUntilIdle();
99 100
100 EXPECT_CALL(handler_, OnConnectionClosed(viewer_.get(), SESSION_REJECTED)); 101 EXPECT_CALL(handler_, OnConnectionClosed(viewer_.get(), SESSION_REJECTED));
101 session_->set_error(SESSION_REJECTED); 102 session_->set_error(SESSION_REJECTED);
102 session_->event_handler()->OnSessionStateChange(Session::FAILED); 103 session_->event_handler()->OnSessionStateChange(Session::FAILED);
103 base::RunLoop().RunUntilIdle(); 104 base::RunLoop().RunUntilIdle();
104 } 105 }
105 106
106 } // namespace protocol 107 } // namespace protocol
107 } // namespace remoting 108 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/channel_multiplexer_unittest.cc ('k') | remoting/protocol/fake_datagram_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698