OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "content/browser/browser_thread_impl.h" | 9 #include "content/browser/browser_thread_impl.h" |
10 #include "content/browser/mock_resource_context.h" | 10 #include "content/browser/mock_resource_context.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 host_->OnGenerateStream(kPageRequestId, options); | 296 host_->OnGenerateStream(kPageRequestId, options); |
297 WaitForResult(); | 297 WaitForResult(); |
298 std::string label = host_->label_; | 298 std::string label = host_->label_; |
299 | 299 |
300 EXPECT_EQ(host_->audio_devices_.size(), 0u); | 300 EXPECT_EQ(host_->audio_devices_.size(), 0u); |
301 EXPECT_EQ(host_->video_devices_.size(), 1u); | 301 EXPECT_EQ(host_->video_devices_.size(), 1u); |
302 EXPECT_EQ(host_->NumberOfStreams(), 1u); | 302 EXPECT_EQ(host_->NumberOfStreams(), 1u); |
303 | 303 |
304 EXPECT_CALL(*host_, OnVideoDeviceFailed(kRenderId, 0)); | 304 EXPECT_CALL(*host_, OnVideoDeviceFailed(kRenderId, 0)); |
305 int session_id = host_->video_devices_[0].session_id; | 305 int session_id = host_->video_devices_[0].session_id; |
306 content::MockResourceContext::GetInstance()->media_stream_manager()-> | 306 content::MockResourceContext::GetInstance()->GetMediaStreamManager()-> |
307 video_capture_manager()->Error(session_id); | 307 video_capture_manager()->Error(session_id); |
308 WaitForResult(); | 308 WaitForResult(); |
309 EXPECT_EQ(host_->video_devices_.size(), 0u); | 309 EXPECT_EQ(host_->video_devices_.size(), 0u); |
310 EXPECT_EQ(host_->NumberOfStreams(), 1u); | 310 EXPECT_EQ(host_->NumberOfStreams(), 1u); |
311 | 311 |
312 // TODO(perkj): test audio device failure? | 312 // TODO(perkj): test audio device failure? |
313 | 313 |
314 host_->OnStopGeneratedStream(label); | 314 host_->OnStopGeneratedStream(label); |
315 EXPECT_EQ(host_->NumberOfStreams(), 0u); | 315 EXPECT_EQ(host_->NumberOfStreams(), 0u); |
316 } | 316 } |
317 | 317 |
318 }; // namespace media_stream | 318 }; // namespace media_stream |
OLD | NEW |