Chromium Code Reviews| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 458 vcm_->Unregister(); | 458 vcm_->Unregister(); |
| 459 } | 459 } |
| 460 | 460 |
| 461 // Try open a non-existing device. | 461 // Try open a non-existing device. |
| 462 TEST_F(VideoCaptureManagerTest, OpenNotExisting) { | 462 TEST_F(VideoCaptureManagerTest, OpenNotExisting) { |
| 463 StreamDeviceInfoArray devices; | 463 StreamDeviceInfoArray devices; |
| 464 | 464 |
| 465 InSequence s; | 465 InSequence s; |
| 466 EXPECT_CALL(*listener_, DevicesEnumerated(MEDIA_DEVICE_VIDEO_CAPTURE, _)) | 466 EXPECT_CALL(*listener_, DevicesEnumerated(MEDIA_DEVICE_VIDEO_CAPTURE, _)) |
| 467 .WillOnce(SaveArg<1>(&devices)); | 467 .WillOnce(SaveArg<1>(&devices)); |
| 468 EXPECT_CALL(*frame_observer_, OnError(_)); | |
| 468 EXPECT_CALL(*listener_, Opened(MEDIA_DEVICE_VIDEO_CAPTURE, _)); | 469 EXPECT_CALL(*listener_, Opened(MEDIA_DEVICE_VIDEO_CAPTURE, _)); |
|
nisse-chromium (ooo August 14)
2015/12/03 12:37:10
Not sure from when the Opened event is called, and
| |
| 469 EXPECT_CALL(*frame_observer_, OnError(_)); | |
| 470 EXPECT_CALL(*listener_, Closed(MEDIA_DEVICE_VIDEO_CAPTURE, _)); | 470 EXPECT_CALL(*listener_, Closed(MEDIA_DEVICE_VIDEO_CAPTURE, _)); |
| 471 | 471 |
| 472 vcm_->EnumerateDevices(MEDIA_DEVICE_VIDEO_CAPTURE); | 472 vcm_->EnumerateDevices(MEDIA_DEVICE_VIDEO_CAPTURE); |
| 473 | 473 |
| 474 // Wait to get device callback. | 474 // Wait to get device callback. |
| 475 message_loop_->RunUntilIdle(); | 475 message_loop_->RunUntilIdle(); |
| 476 | 476 |
| 477 MediaStreamType stream_type = MEDIA_DEVICE_VIDEO_CAPTURE; | 477 MediaStreamType stream_type = MEDIA_DEVICE_VIDEO_CAPTURE; |
| 478 std::string device_name("device_doesnt_exist"); | 478 std::string device_name("device_doesnt_exist"); |
| 479 std::string device_id("id_doesnt_exist"); | 479 std::string device_id("id_doesnt_exist"); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 557 | 557 |
| 558 // Wait to check callbacks before removing the listener. | 558 // Wait to check callbacks before removing the listener. |
| 559 message_loop_->RunUntilIdle(); | 559 message_loop_->RunUntilIdle(); |
| 560 vcm_->Unregister(); | 560 vcm_->Unregister(); |
| 561 } | 561 } |
| 562 | 562 |
| 563 // TODO(mcasas): Add a test to check consolidation of the supported formats | 563 // TODO(mcasas): Add a test to check consolidation of the supported formats |
| 564 // provided by the device when http://crbug.com/323913 is closed. | 564 // provided by the device when http://crbug.com/323913 is closed. |
| 565 | 565 |
| 566 } // namespace content | 566 } // namespace content |
| OLD | NEW |