Commit 0e325586 authored by perkj@chromium.org's avatar perkj@chromium.org

Disables camera hardware dependent tests.

Also increase the time the test is allowed to wait for a video frame. 

TEST= 
BUG=94134

Review URL: http://codereview.chromium.org/7757002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98691 0039d316-1c4b-4281-b951-d872f2087c98
parent 9795d0c0
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/synchronization/waitable_event.h" #include "base/synchronization/waitable_event.h"
#include "base/test/test_timeouts.h"
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "media/video/capture/fake_video_capture_device.h" #include "media/video/capture/fake_video_capture_device.h"
#include "media/video/capture/video_capture_device.h" #include "media/video/capture/video_capture_device.h"
...@@ -16,7 +17,6 @@ using ::testing::Return; ...@@ -16,7 +17,6 @@ using ::testing::Return;
using ::testing::AtLeast; using ::testing::AtLeast;
namespace media { namespace media {
const int kWaitTime = 3000;
class MockFrameObserver: public media::VideoCaptureDevice::EventHandler { class MockFrameObserver: public media::VideoCaptureDevice::EventHandler {
public: public:
...@@ -69,9 +69,10 @@ TEST_F(VideoCaptureDeviceTest, OpenInvalidDevice) { ...@@ -69,9 +69,10 @@ TEST_F(VideoCaptureDeviceTest, OpenInvalidDevice) {
EXPECT_TRUE(device == NULL); EXPECT_TRUE(device == NULL);
} }
TEST_F(VideoCaptureDeviceTest, CaptureVGA) { // TODO(perkj): This test is disabled due to stability problem with certain
// cameras. http://www.crbug.com/94134
TEST_F(VideoCaptureDeviceTest, DISABLED_CaptureVGA) {
VideoCaptureDevice::GetDeviceNames(&names_); VideoCaptureDevice::GetDeviceNames(&names_);
// Make sure there are more than 0 cameras.
if (!names_.size()) { if (!names_.size()) {
LOG(WARNING) << "No camera available. Exiting test."; LOG(WARNING) << "No camera available. Exiting test.";
return; return;
...@@ -91,15 +92,16 @@ TEST_F(VideoCaptureDeviceTest, CaptureVGA) { ...@@ -91,15 +92,16 @@ TEST_F(VideoCaptureDeviceTest, CaptureVGA) {
device->Allocate(640, 480, 30, frame_observer_.get()); device->Allocate(640, 480, 30, frame_observer_.get());
device->Start(); device->Start();
// Wait for 3s or for captured frame. // Wait for 3s or for captured frame.
EXPECT_TRUE(wait_event_.TimedWait( EXPECT_TRUE(wait_event_.TimedWait(base::TimeDelta::FromMilliseconds(
base::TimeDelta::FromMilliseconds(kWaitTime))); TestTimeouts::action_max_timeout_ms())));
device->Stop(); device->Stop();
device->DeAllocate(); device->DeAllocate();
} }
TEST_F(VideoCaptureDeviceTest, Capture720p) { // TODO(perkj): This test is disabled due to stability problem with certain
// cameras. http://www.crbug.com/94134
TEST_F(VideoCaptureDeviceTest, DISABLED_Capture720p) {
VideoCaptureDevice::GetDeviceNames(&names_); VideoCaptureDevice::GetDeviceNames(&names_);
// Make sure there are more than 0 cameras.
if (!names_.size()) { if (!names_.size()) {
LOG(WARNING) << "No camera available. Exiting test."; LOG(WARNING) << "No camera available. Exiting test.";
return; return;
...@@ -121,13 +123,15 @@ TEST_F(VideoCaptureDeviceTest, Capture720p) { ...@@ -121,13 +123,15 @@ TEST_F(VideoCaptureDeviceTest, Capture720p) {
device->Allocate(1280, 720, 30, frame_observer_.get()); device->Allocate(1280, 720, 30, frame_observer_.get());
device->Start(); device->Start();
// Get captured video frames. // Get captured video frames.
EXPECT_TRUE(wait_event_.TimedWait( EXPECT_TRUE(wait_event_.TimedWait(base::TimeDelta::FromMilliseconds(
base::TimeDelta::FromMilliseconds(kWaitTime))); TestTimeouts::action_max_timeout_ms())));
device->Stop(); device->Stop();
device->DeAllocate(); device->DeAllocate();
} }
TEST_F(VideoCaptureDeviceTest, AllocateSameCameraTwice) { // TODO(perkj): This test is disabled due to stability problem with certain
// cameras. http://www.crbug.com/94134
TEST_F(VideoCaptureDeviceTest, DISABLED_AllocateSameCameraTwice) {
VideoCaptureDevice::GetDeviceNames(&names_); VideoCaptureDevice::GetDeviceNames(&names_);
if (!names_.size()) { if (!names_.size()) {
LOG(WARNING) << "No camera available. Exiting test."; LOG(WARNING) << "No camera available. Exiting test.";
...@@ -154,7 +158,9 @@ TEST_F(VideoCaptureDeviceTest, AllocateSameCameraTwice) { ...@@ -154,7 +158,9 @@ TEST_F(VideoCaptureDeviceTest, AllocateSameCameraTwice) {
device2->DeAllocate(); device2->DeAllocate();
} }
TEST_F(VideoCaptureDeviceTest, AllocateBadSize) { // TODO(perkj): This test is disabled due to stability problem with certain
// cameras. http://www.crbug.com/94134
TEST_F(VideoCaptureDeviceTest, DISABLED_AllocateBadSize) {
VideoCaptureDevice::GetDeviceNames(&names_); VideoCaptureDevice::GetDeviceNames(&names_);
if (!names_.size()) { if (!names_.size()) {
LOG(WARNING) << "No camera available. Exiting test."; LOG(WARNING) << "No camera available. Exiting test.";
...@@ -175,7 +181,9 @@ TEST_F(VideoCaptureDeviceTest, AllocateBadSize) { ...@@ -175,7 +181,9 @@ TEST_F(VideoCaptureDeviceTest, AllocateBadSize) {
device->DeAllocate(); device->DeAllocate();
} }
TEST_F(VideoCaptureDeviceTest, ReAllocateCamera) { // TODO(perkj): This test is disabled due to stability problem with certain
// cameras. http://www.crbug.com/94134
TEST_F(VideoCaptureDeviceTest, DISABLED_ReAllocateCamera) {
VideoCaptureDevice::GetDeviceNames(&names_); VideoCaptureDevice::GetDeviceNames(&names_);
if (!names_.size()) { if (!names_.size()) {
LOG(WARNING) << "No camera available. Exiting test."; LOG(WARNING) << "No camera available. Exiting test.";
...@@ -201,13 +209,15 @@ TEST_F(VideoCaptureDeviceTest, ReAllocateCamera) { ...@@ -201,13 +209,15 @@ TEST_F(VideoCaptureDeviceTest, ReAllocateCamera) {
device->Start(); device->Start();
// Get captured video frames. // Get captured video frames.
EXPECT_TRUE(wait_event_.TimedWait( EXPECT_TRUE(wait_event_.TimedWait(base::TimeDelta::FromMilliseconds(
base::TimeDelta::FromMilliseconds(kWaitTime))); TestTimeouts::action_max_timeout_ms())));
device->Stop(); device->Stop();
device->DeAllocate(); device->DeAllocate();
} }
TEST_F(VideoCaptureDeviceTest, DeAllocateCameraWhileRunning) { // TODO(perkj): This test is disabled due to stability problem with certain
// cameras. http://www.crbug.com/94134
TEST_F(VideoCaptureDeviceTest, DISABLED_DeAllocateCameraWhileRunning) {
VideoCaptureDevice::GetDeviceNames(&names_); VideoCaptureDevice::GetDeviceNames(&names_);
if (!names_.size()) { if (!names_.size()) {
LOG(WARNING) << "No camera available. Exiting test."; LOG(WARNING) << "No camera available. Exiting test.";
...@@ -226,8 +236,8 @@ TEST_F(VideoCaptureDeviceTest, DeAllocateCameraWhileRunning) { ...@@ -226,8 +236,8 @@ TEST_F(VideoCaptureDeviceTest, DeAllocateCameraWhileRunning) {
device->Start(); device->Start();
// Get captured video frames. // Get captured video frames.
EXPECT_TRUE(wait_event_.TimedWait( EXPECT_TRUE(wait_event_.TimedWait(base::TimeDelta::FromMilliseconds(
base::TimeDelta::FromMilliseconds(kWaitTime))); TestTimeouts::action_max_timeout_ms())));
device->DeAllocate(); device->DeAllocate();
} }
...@@ -252,8 +262,8 @@ TEST_F(VideoCaptureDeviceTest, TestFakeCapture) { ...@@ -252,8 +262,8 @@ TEST_F(VideoCaptureDeviceTest, TestFakeCapture) {
device->Allocate(640, 480, 30, frame_observer_.get()); device->Allocate(640, 480, 30, frame_observer_.get());
device->Start(); device->Start();
EXPECT_TRUE(wait_event_.TimedWait( EXPECT_TRUE(wait_event_.TimedWait(base::TimeDelta::FromMilliseconds(
base::TimeDelta::FromMilliseconds(kWaitTime))); TestTimeouts::action_max_timeout_ms())));
device->Stop(); device->Stop();
device->DeAllocate(); device->DeAllocate();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment