| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdint.h> |
| 6 |
| 5 #include "base/callback.h" | 7 #include "base/callback.h" |
| 6 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 7 #include "base/time/default_tick_clock.h" | 9 #include "base/time/default_tick_clock.h" |
| 8 #include "chrome/browser/media/cast_transport_host_filter.h" | 10 #include "chrome/browser/media/cast_transport_host_filter.h" |
| 9 #include "chrome/common/cast_messages.h" | 11 #include "chrome/common/cast_messages.h" |
| 10 #include "content/public/test/test_browser_thread_bundle.h" | 12 #include "content/public/test/test_browser_thread_bundle.h" |
| 11 #include "media/cast/logging/logging_defines.h" | 13 #include "media/cast/logging/logging_defines.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 15 |
| 14 namespace { | 16 namespace { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 for (int i = 0; i < 60; i++) { | 78 for (int i = 0; i < 60; i++) { |
| 77 CastHostMsg_Delete delete_msg(i); | 79 CastHostMsg_Delete delete_msg(i); |
| 78 FakeSend(delete_msg); | 80 FakeSend(delete_msg); |
| 79 } | 81 } |
| 80 | 82 |
| 81 // Leave some open, see what happens. | 83 // Leave some open, see what happens. |
| 82 } | 84 } |
| 83 | 85 |
| 84 TEST_F(CastTransportHostFilterTest, SimpleMessages) { | 86 TEST_F(CastTransportHostFilterTest, SimpleMessages) { |
| 85 // Create a cast transport sender. | 87 // Create a cast transport sender. |
| 86 const int32 kChannelId = 42; | 88 const int32_t kChannelId = 42; |
| 87 CastHostMsg_New new_msg(kChannelId, | 89 CastHostMsg_New new_msg(kChannelId, |
| 88 receive_endpoint_, | 90 receive_endpoint_, |
| 89 net::IPEndPoint(), | 91 net::IPEndPoint(), |
| 90 options_); | 92 options_); |
| 91 FakeSend(new_msg); | 93 FakeSend(new_msg); |
| 92 | 94 |
| 93 media::cast::CastTransportRtpConfig audio_config; | 95 media::cast::CastTransportRtpConfig audio_config; |
| 94 audio_config.ssrc = 1; | 96 audio_config.ssrc = 1; |
| 95 audio_config.feedback_ssrc = 2; | 97 audio_config.feedback_ssrc = 2; |
| 96 CastHostMsg_InitializeAudio init_audio_msg(kChannelId, audio_config); | 98 CastHostMsg_InitializeAudio init_audio_msg(kChannelId, audio_config); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 122 // are generated. | 124 // are generated. |
| 123 const int kVideoDataSize = 4711; | 125 const int kVideoDataSize = 4711; |
| 124 video_frame.data = std::string(kVideoDataSize, 'p'); | 126 video_frame.data = std::string(kVideoDataSize, 'p'); |
| 125 CastHostMsg_InsertFrame insert_video_frame(11, kChannelId, video_frame); | 127 CastHostMsg_InsertFrame insert_video_frame(11, kChannelId, video_frame); |
| 126 FakeSend(insert_video_frame); | 128 FakeSend(insert_video_frame); |
| 127 | 129 |
| 128 CastHostMsg_SendSenderReport rtcp_msg( | 130 CastHostMsg_SendSenderReport rtcp_msg( |
| 129 kChannelId, 1, base::TimeTicks(), 2); | 131 kChannelId, 1, base::TimeTicks(), 2); |
| 130 FakeSend(rtcp_msg); | 132 FakeSend(rtcp_msg); |
| 131 | 133 |
| 132 std::vector<uint32> frame_ids; | 134 std::vector<uint32_t> frame_ids; |
| 133 frame_ids.push_back(1); | 135 frame_ids.push_back(1); |
| 134 CastHostMsg_CancelSendingFrames cancel_msg(kChannelId, 1, frame_ids); | 136 CastHostMsg_CancelSendingFrames cancel_msg(kChannelId, 1, frame_ids); |
| 135 FakeSend(cancel_msg); | 137 FakeSend(cancel_msg); |
| 136 | 138 |
| 137 CastHostMsg_ResendFrameForKickstart kickstart_msg(kChannelId, 1, 1); | 139 CastHostMsg_ResendFrameForKickstart kickstart_msg(kChannelId, 1, 1); |
| 138 FakeSend(kickstart_msg); | 140 FakeSend(kickstart_msg); |
| 139 | 141 |
| 140 CastHostMsg_Delete delete_msg(kChannelId); | 142 CastHostMsg_Delete delete_msg(kChannelId); |
| 141 FakeSend(delete_msg); | 143 FakeSend(delete_msg); |
| 142 } | 144 } |
| 143 | 145 |
| 144 } // namespace | 146 } // namespace |
| OLD | NEW |