| 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 // Unit test for VideoCaptureManager. | 5 // Unit test for VideoCaptureManager. |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/media/video_capture_manager.h" | 7 #include "content/browser/renderer_host/media/video_capture_manager.h" |
| 8 | 8 |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 void OnGotControllerCallback( | 98 void OnGotControllerCallback( |
| 99 VideoCaptureControllerID id, | 99 VideoCaptureControllerID id, |
| 100 base::Closure quit_closure, | 100 base::Closure quit_closure, |
| 101 bool expect_success, | 101 bool expect_success, |
| 102 const base::WeakPtr<VideoCaptureController>& controller) { | 102 const base::WeakPtr<VideoCaptureController>& controller) { |
| 103 if (expect_success) { | 103 if (expect_success) { |
| 104 ASSERT_TRUE(controller); | 104 ASSERT_TRUE(controller); |
| 105 ASSERT_TRUE(0 == controllers_.count(id)); | 105 ASSERT_TRUE(0 == controllers_.count(id)); |
| 106 controllers_[id] = controller.get(); | 106 controllers_[id] = controller.get(); |
| 107 } else { | 107 } else { |
| 108 ASSERT_TRUE(NULL == controller); | 108 ASSERT_FALSE(controller); |
| 109 } | 109 } |
| 110 quit_closure.Run(); | 110 quit_closure.Run(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 VideoCaptureControllerID StartClient(int session_id, bool expect_success) { | 113 VideoCaptureControllerID StartClient(int session_id, bool expect_success) { |
| 114 media::VideoCaptureParams params; | 114 media::VideoCaptureParams params; |
| 115 params.requested_format = media::VideoCaptureFormat( | 115 params.requested_format = media::VideoCaptureFormat( |
| 116 gfx::Size(320, 240), 30, media::PIXEL_FORMAT_I420); | 116 gfx::Size(320, 240), 30, media::PIXEL_FORMAT_I420); |
| 117 | 117 |
| 118 VideoCaptureControllerID client_id(next_client_id_++); | 118 VideoCaptureControllerID client_id(next_client_id_++); |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 // Wait to check callbacks before removing the listener. | 616 // Wait to check callbacks before removing the listener. |
| 617 message_loop_->RunUntilIdle(); | 617 message_loop_->RunUntilIdle(); |
| 618 vcm_->Unregister(); | 618 vcm_->Unregister(); |
| 619 } | 619 } |
| 620 #endif | 620 #endif |
| 621 | 621 |
| 622 // TODO(mcasas): Add a test to check consolidation of the supported formats | 622 // TODO(mcasas): Add a test to check consolidation of the supported formats |
| 623 // provided by the device when http://crbug.com/323913 is closed. | 623 // provided by the device when http://crbug.com/323913 is closed. |
| 624 | 624 |
| 625 } // namespace content | 625 } // namespace content |
| OLD | NEW |