Index: media/video/capture/video_capture_device_unittest.cc |
=================================================================== |
--- media/video/capture/video_capture_device_unittest.cc (revision 98610) |
+++ media/video/capture/video_capture_device_unittest.cc (working copy) |
@@ -4,6 +4,7 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/synchronization/waitable_event.h" |
+#include "base/test/test_timeouts.h" |
#include "base/threading/thread.h" |
#include "media/video/capture/fake_video_capture_device.h" |
#include "media/video/capture/video_capture_device.h" |
@@ -16,7 +17,6 @@ |
using ::testing::AtLeast; |
namespace media { |
-const int kWaitTime = 3000; |
class MockFrameObserver: public media::VideoCaptureDevice::EventHandler { |
public: |
@@ -69,7 +69,11 @@ |
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 |
+// Also we don't want to run the test on try-bots since there is no camera |
scherkus (not reviewing)
2011/08/29 16:22:28
nit: these comments about not running on try bots
perkj_chrome
2011/08/29 16:50:22
Done.
|
+// available. |
+TEST_F(VideoCaptureDeviceTest, DISABLED_CaptureVGA) { |
VideoCaptureDevice::GetDeviceNames(&names_); |
// Make sure there are more than 0 cameras. |
scherkus (not reviewing)
2011/08/29 16:22:28
other tests have this comment removed -- want to f
perkj_chrome
2011/08/29 16:50:22
Done.
|
if (!names_.size()) { |
@@ -91,13 +95,17 @@ |
device->Allocate(640, 480, 30, frame_observer_.get()); |
device->Start(); |
// Wait for 3s or for captured frame. |
- EXPECT_TRUE(wait_event_.TimedWait( |
- base::TimeDelta::FromMilliseconds(kWaitTime))); |
+ EXPECT_TRUE(wait_event_.TimedWait(base::TimeDelta::FromMilliseconds( |
+ TestTimeouts::action_max_timeout_ms()))); |
device->Stop(); |
device->DeAllocate(); |
} |
-TEST_F(VideoCaptureDeviceTest, Capture720p) { |
+// TODO(perkj): This test is disabled due to stability problem with certain |
+// cameras. http://www.crbug.com/94134 |
+// Also we don't want to run the test on try-bots since there is no camera |
+// available. |
+TEST_F(VideoCaptureDeviceTest, DISABLED_Capture720p) { |
VideoCaptureDevice::GetDeviceNames(&names_); |
// Make sure there are more than 0 cameras. |
scherkus (not reviewing)
2011/08/29 16:22:28
ditto on both comments
perkj_chrome
2011/08/29 16:50:22
Done.
|
if (!names_.size()) { |
@@ -121,13 +129,17 @@ |
device->Allocate(1280, 720, 30, frame_observer_.get()); |
device->Start(); |
// Get captured video frames. |
- EXPECT_TRUE(wait_event_.TimedWait( |
- base::TimeDelta::FromMilliseconds(kWaitTime))); |
+ EXPECT_TRUE(wait_event_.TimedWait(base::TimeDelta::FromMilliseconds( |
+ TestTimeouts::action_max_timeout_ms()))); |
device->Stop(); |
device->DeAllocate(); |
} |
-TEST_F(VideoCaptureDeviceTest, AllocateSameCameraTwice) { |
+// TODO(perkj): This test is disabled due to stability problem with certain |
+// cameras. http://www.crbug.com/94134 |
+// Also we don't want to run the test on try-bots since there is no camera |
scherkus (not reviewing)
2011/08/29 16:22:28
ditto
perkj_chrome
2011/08/29 16:50:22
Done.
|
+// available. |
+TEST_F(VideoCaptureDeviceTest, DISABLED_AllocateSameCameraTwice) { |
VideoCaptureDevice::GetDeviceNames(&names_); |
if (!names_.size()) { |
LOG(WARNING) << "No camera available. Exiting test."; |
@@ -154,7 +166,11 @@ |
device2->DeAllocate(); |
} |
-TEST_F(VideoCaptureDeviceTest, AllocateBadSize) { |
+// TODO(perkj): This test is disabled due to stability problem with certain |
+// cameras. http://www.crbug.com/94134 |
+// Also we don't want to run the test on try-bots since there is no camera |
scherkus (not reviewing)
2011/08/29 16:22:28
ditto
perkj_chrome
2011/08/29 16:50:22
Done.
|
+// available. |
+TEST_F(VideoCaptureDeviceTest, DISABLED_AllocateBadSize) { |
VideoCaptureDevice::GetDeviceNames(&names_); |
if (!names_.size()) { |
LOG(WARNING) << "No camera available. Exiting test."; |
@@ -175,7 +191,11 @@ |
device->DeAllocate(); |
} |
-TEST_F(VideoCaptureDeviceTest, ReAllocateCamera) { |
+// TODO(perkj): This test is disabled due to stability problem with certain |
+// cameras. http://www.crbug.com/94134 |
+// Also we don't want to run the test on try-bots since there is no camera |
+// available. |
scherkus (not reviewing)
2011/08/29 16:22:28
ditto
perkj_chrome
2011/08/29 16:50:22
Done.
|
+TEST_F(VideoCaptureDeviceTest, DISABLED_ReAllocateCamera) { |
VideoCaptureDevice::GetDeviceNames(&names_); |
if (!names_.size()) { |
LOG(WARNING) << "No camera available. Exiting test."; |
@@ -201,13 +221,17 @@ |
device->Start(); |
// Get captured video frames. |
- EXPECT_TRUE(wait_event_.TimedWait( |
- base::TimeDelta::FromMilliseconds(kWaitTime))); |
+ EXPECT_TRUE(wait_event_.TimedWait(base::TimeDelta::FromMilliseconds( |
+ TestTimeouts::action_max_timeout_ms()))); |
device->Stop(); |
device->DeAllocate(); |
} |
-TEST_F(VideoCaptureDeviceTest, DeAllocateCameraWhileRunning) { |
+// TODO(perkj): This test is disabled due to stability problem with certain |
+// cameras. http://www.crbug.com/94134 |
+// Also we don't want to run the test on try-bots since there is no camera |
+// available. |
scherkus (not reviewing)
2011/08/29 16:22:28
ditto
perkj_chrome
2011/08/29 16:50:22
Done.
|
+TEST_F(VideoCaptureDeviceTest, DISABLED_DeAllocateCameraWhileRunning) { |
VideoCaptureDevice::GetDeviceNames(&names_); |
if (!names_.size()) { |
LOG(WARNING) << "No camera available. Exiting test."; |
@@ -226,8 +250,8 @@ |
device->Start(); |
// Get captured video frames. |
- EXPECT_TRUE(wait_event_.TimedWait( |
- base::TimeDelta::FromMilliseconds(kWaitTime))); |
+ EXPECT_TRUE(wait_event_.TimedWait(base::TimeDelta::FromMilliseconds( |
+ TestTimeouts::action_max_timeout_ms()))); |
device->DeAllocate(); |
} |
@@ -252,8 +276,8 @@ |
device->Allocate(640, 480, 30, frame_observer_.get()); |
device->Start(); |
- EXPECT_TRUE(wait_event_.TimedWait( |
- base::TimeDelta::FromMilliseconds(kWaitTime))); |
+ EXPECT_TRUE(wait_event_.TimedWait(base::TimeDelta::FromMilliseconds( |
+ TestTimeouts::action_max_timeout_ms()))); |
device->Stop(); |
device->DeAllocate(); |
} |