| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "media/base/data_buffer.h" | 6 #include "media/base/data_buffer.h" |
| 7 #include "remoting/base/mock_objects.h" | 7 #include "remoting/base/mock_objects.h" |
| 8 #include "remoting/host/client_connection.h" | 8 #include "remoting/host/client_connection.h" |
| 9 #include "remoting/host/mock_objects.h" | 9 #include "remoting/host/mock_objects.h" |
| 10 #include "remoting/jingle_glue/mock_objects.h" | 10 #include "remoting/jingle_glue/mock_objects.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 DISALLOW_COPY_AND_ASSIGN(ClientConnectionTest); | 44 DISALLOW_COPY_AND_ASSIGN(ClientConnectionTest); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 TEST_F(ClientConnectionTest, SendUpdateStream) { | 47 TEST_F(ClientConnectionTest, SendUpdateStream) { |
| 48 // Tell the viewer we are starting an update stream. | 48 // Tell the viewer we are starting an update stream. |
| 49 EXPECT_CALL(*channel_, Write(_)); | 49 EXPECT_CALL(*channel_, Write(_)); |
| 50 viewer_->SendBeginUpdateStreamMessage(); | 50 viewer_->SendBeginUpdateStreamMessage(); |
| 51 | 51 |
| 52 // Then send the actual data. | 52 // Then send the actual data. |
| 53 EXPECT_CALL(*channel_, Write(_)); | 53 EXPECT_CALL(*channel_, Write(_)); |
| 54 chromotocol_pb::UpdateStreamPacketHeader* header | 54 UpdateStreamPacketHeader* header = new UpdateStreamPacketHeader(); |
| 55 = new chromotocol_pb::UpdateStreamPacketHeader(); | |
| 56 header->set_x(0); | 55 header->set_x(0); |
| 57 header->set_y(0); | 56 header->set_y(0); |
| 58 header->set_width(640); | 57 header->set_width(640); |
| 59 header->set_height(480); | 58 header->set_height(480); |
| 60 scoped_refptr<media::DataBuffer> data = new media::DataBuffer(10); | 59 scoped_refptr<media::DataBuffer> data = new media::DataBuffer(10); |
| 61 viewer_->SendUpdateStreamPacketMessage(header, data); | 60 viewer_->SendUpdateStreamPacketMessage(header, data); |
| 62 delete header; | 61 delete header; |
| 63 | 62 |
| 64 // Send the end of update message. | 63 // Send the end of update message. |
| 65 EXPECT_CALL(*channel_, Write(_)); | 64 EXPECT_CALL(*channel_, Write(_)); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 90 // Give the data to the ClientConnection, it will use ProtocolDecoder to | 89 // Give the data to the ClientConnection, it will use ProtocolDecoder to |
| 91 // decode the messages. | 90 // decode the messages. |
| 92 EXPECT_CALL(*decoder_, ParseClientMessages(data, NotNull())); | 91 EXPECT_CALL(*decoder_, ParseClientMessages(data, NotNull())); |
| 93 EXPECT_CALL(handler_, HandleMessages(viewer_.get(), NotNull())); | 92 EXPECT_CALL(handler_, HandleMessages(viewer_.get(), NotNull())); |
| 94 | 93 |
| 95 viewer_->OnPacketReceived(channel_.get(), data); | 94 viewer_->OnPacketReceived(channel_.get(), data); |
| 96 message_loop_.RunAllPending(); | 95 message_loop_.RunAllPending(); |
| 97 } | 96 } |
| 98 | 97 |
| 99 } // namespace remoting | 98 } // namespace remoting |
| OLD | NEW |