| 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 VideoCaptureController. | 5 // Unit test for VideoCaptureController. |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 int length, int buffer_id) OVERRIDE { | 61 int length, int buffer_id) OVERRIDE { |
| 62 DoBufferCreated(id); | 62 DoBufferCreated(id); |
| 63 } | 63 } |
| 64 virtual void OnBufferDestroyed(const VideoCaptureControllerID& id, | 64 virtual void OnBufferDestroyed(const VideoCaptureControllerID& id, |
| 65 int buffer_id) OVERRIDE { | 65 int buffer_id) OVERRIDE { |
| 66 DoBufferDestroyed(id); | 66 DoBufferDestroyed(id); |
| 67 } | 67 } |
| 68 virtual void OnBufferReady(const VideoCaptureControllerID& id, | 68 virtual void OnBufferReady(const VideoCaptureControllerID& id, |
| 69 int buffer_id, | 69 int buffer_id, |
| 70 const media::VideoCaptureFormat& format, | 70 const media::VideoCaptureFormat& format, |
| 71 const gfx::Rect& visible_rect, |
| 71 base::TimeTicks timestamp) OVERRIDE { | 72 base::TimeTicks timestamp) OVERRIDE { |
| 72 DoBufferReady(id); | 73 DoBufferReady(id); |
| 73 base::MessageLoop::current()->PostTask( | 74 base::MessageLoop::current()->PostTask( |
| 74 FROM_HERE, | 75 FROM_HERE, |
| 75 base::Bind(&VideoCaptureController::ReturnBuffer, | 76 base::Bind(&VideoCaptureController::ReturnBuffer, |
| 76 base::Unretained(controller_), | 77 base::Unretained(controller_), |
| 77 id, | 78 id, |
| 78 this, | 79 this, |
| 79 buffer_id, | 80 buffer_id, |
| 80 0)); | 81 0)); |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 | 635 |
| 635 // Second client connects after the error state. It also should get told of | 636 // Second client connects after the error state. It also should get told of |
| 636 // the error. | 637 // the error. |
| 637 EXPECT_CALL(*client_b_, DoError(route_id)).Times(1); | 638 EXPECT_CALL(*client_b_, DoError(route_id)).Times(1); |
| 638 controller_->AddClient( | 639 controller_->AddClient( |
| 639 route_id, client_b_.get(), base::kNullProcessHandle, 200, session_200); | 640 route_id, client_b_.get(), base::kNullProcessHandle, 200, session_200); |
| 640 Mock::VerifyAndClearExpectations(client_b_.get()); | 641 Mock::VerifyAndClearExpectations(client_b_.get()); |
| 641 } | 642 } |
| 642 | 643 |
| 643 } // namespace content | 644 } // namespace content |
| OLD | NEW |