| OLD | NEW |
| 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "content/renderer/media/media_stream_extra_data.h" | 8 #include "content/renderer/media/media_stream_extra_data.h" |
| 9 #include "content/renderer/media/media_stream_impl.h" | 9 #include "content/renderer/media/media_stream_impl.h" |
| 10 #include "content/renderer/media/mock_media_stream_dependency_factory.h" | 10 #include "content/renderer/media/mock_media_stream_dependency_factory.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 if (!extra_data || !extra_data->local_stream()) { | 105 if (!extra_data || !extra_data->local_stream()) { |
| 106 ADD_FAILURE(); | 106 ADD_FAILURE(); |
| 107 return desc; | 107 return desc; |
| 108 } | 108 } |
| 109 | 109 |
| 110 if (audio) | 110 if (audio) |
| 111 EXPECT_EQ(1u, extra_data->local_stream()->audio_tracks()->count()); | 111 EXPECT_EQ(1u, extra_data->local_stream()->audio_tracks()->count()); |
| 112 if (video) | 112 if (video) |
| 113 EXPECT_EQ(1u, extra_data->local_stream()->video_tracks()->count()); | 113 EXPECT_EQ(1u, extra_data->local_stream()->video_tracks()->count()); |
| 114 if (audio && video) { | 114 if (audio && video) { |
| 115 EXPECT_NE(extra_data->local_stream()->audio_tracks()->at(0)->label(), | 115 EXPECT_NE(extra_data->local_stream()->audio_tracks()->at(0)->id(), |
| 116 extra_data->local_stream()->video_tracks()->at(0)->label()); | 116 extra_data->local_stream()->video_tracks()->at(0)->id()); |
| 117 } | 117 } |
| 118 return desc; | 118 return desc; |
| 119 } | 119 } |
| 120 | 120 |
| 121 | 121 |
| 122 void FakeMediaStreamDispatcherComplete() { | 122 void FakeMediaStreamDispatcherComplete() { |
| 123 ms_impl_->OnStreamGenerated(ms_dispatcher_->request_id(), | 123 ms_impl_->OnStreamGenerated(ms_dispatcher_->request_id(), |
| 124 ms_dispatcher_->stream_label(), | 124 ms_dispatcher_->stream_label(), |
| 125 ms_dispatcher_->audio_array(), | 125 ms_dispatcher_->audio_array(), |
| 126 ms_dispatcher_->video_array()); | 126 ms_dispatcher_->video_array()); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 true); | 235 true); |
| 236 EXPECT_EQ(0, ms_dispatcher_->stop_stream_counter()); | 236 EXPECT_EQ(0, ms_dispatcher_->stop_stream_counter()); |
| 237 EXPECT_EQ(1, ms_dispatcher_->request_stream_counter()); | 237 EXPECT_EQ(1, ms_dispatcher_->request_stream_counter()); |
| 238 ms_impl_->FrameWillClose(NULL); | 238 ms_impl_->FrameWillClose(NULL); |
| 239 EXPECT_EQ(1, ms_dispatcher_->stop_stream_counter()); | 239 EXPECT_EQ(1, ms_dispatcher_->stop_stream_counter()); |
| 240 ms_impl_->OnLocalMediaStreamStop(mixed_desc.label().utf8()); | 240 ms_impl_->OnLocalMediaStreamStop(mixed_desc.label().utf8()); |
| 241 EXPECT_EQ(1, ms_dispatcher_->stop_stream_counter()); | 241 EXPECT_EQ(1, ms_dispatcher_->stop_stream_counter()); |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace content | 244 } // namespace content |
| OLD | NEW |