| 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 <map> | 5 #include <map> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 audio_manager_.reset(media::AudioManager::CreateForTesting()); | 289 audio_manager_.reset(media::AudioManager::CreateForTesting()); |
| 290 #ifndef TEST_REAL_CAPTURE_DEVICE | 290 #ifndef TEST_REAL_CAPTURE_DEVICE |
| 291 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 291 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 292 switches::kUseFakeDeviceForMediaStream); | 292 switches::kUseFakeDeviceForMediaStream); |
| 293 #endif | 293 #endif |
| 294 media_stream_manager_.reset(new MediaStreamManager(audio_manager_.get())); | 294 media_stream_manager_.reset(new MediaStreamManager(audio_manager_.get())); |
| 295 media_stream_manager_->UseFakeUI(scoped_ptr<FakeMediaStreamUIProxy>()); | 295 media_stream_manager_->UseFakeUI(scoped_ptr<FakeMediaStreamUIProxy>()); |
| 296 | 296 |
| 297 // Create a Host and connect it to a simulated IPC channel. | 297 // Create a Host and connect it to a simulated IPC channel. |
| 298 host_ = new MockVideoCaptureHost(media_stream_manager_.get()); | 298 host_ = new MockVideoCaptureHost(media_stream_manager_.get()); |
| 299 host_->OnChannelConnected(base::GetCurrentProcId()); | 299 host_->OnSenderConnected(); |
| 300 | 300 |
| 301 OpenSession(); | 301 OpenSession(); |
| 302 } | 302 } |
| 303 | 303 |
| 304 virtual void TearDown() OVERRIDE { | 304 virtual void TearDown() OVERRIDE { |
| 305 // Verifies and removes the expectations on host_ and | 305 // Verifies and removes the expectations on host_ and |
| 306 // returns true iff successful. | 306 // returns true iff successful. |
| 307 Mock::VerifyAndClearExpectations(host_.get()); | 307 Mock::VerifyAndClearExpectations(host_.get()); |
| 308 EXPECT_EQ(0u, host_->entries_.size()); | 308 EXPECT_EQ(0u, host_->entries_.size()); |
| 309 | 309 |
| 310 CloseSession(); | 310 CloseSession(); |
| 311 | 311 |
| 312 // Simulate closing the IPC channel. | 312 // Simulate closing the IPC sender. |
| 313 host_->OnChannelClosing(); | 313 host_->OnSenderClosing(); |
| 314 | 314 |
| 315 // Release the reference to the mock object. The object will be destructed | 315 // Release the reference to the mock object. The object will be destructed |
| 316 // on the current message loop. | 316 // on the current message loop. |
| 317 host_ = NULL; | 317 host_ = NULL; |
| 318 } | 318 } |
| 319 | 319 |
| 320 void OpenSession() { | 320 void OpenSession() { |
| 321 const int render_process_id = 1; | 321 const int render_process_id = 1; |
| 322 const int render_view_id = 1; | 322 const int render_view_id = 1; |
| 323 const int page_request_id = 1; | 323 const int page_request_id = 1; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 #ifdef DUMP_VIDEO | 535 #ifdef DUMP_VIDEO |
| 536 TEST_F(VideoCaptureHostTest, CaptureAndDumpVideoVga) { | 536 TEST_F(VideoCaptureHostTest, CaptureAndDumpVideoVga) { |
| 537 CaptureAndDumpVideo(640, 480, 30); | 537 CaptureAndDumpVideo(640, 480, 30); |
| 538 } | 538 } |
| 539 TEST_F(VideoCaptureHostTest, CaptureAndDump720P) { | 539 TEST_F(VideoCaptureHostTest, CaptureAndDump720P) { |
| 540 CaptureAndDumpVideo(1280, 720, 30); | 540 CaptureAndDumpVideo(1280, 720, 30); |
| 541 } | 541 } |
| 542 #endif | 542 #endif |
| 543 | 543 |
| 544 } // namespace content | 544 } // namespace content |
| OLD | NEW |