| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "media/video/capture/fake_video_capture_device.h" | 10 #include "media/video/capture/fake_video_capture_device.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 EXPECT_EQ(supported_formats[1].frame_size.height(), 480); | 162 EXPECT_EQ(supported_formats[1].frame_size.height(), 480); |
| 163 EXPECT_EQ(supported_formats[1].pixel_format, media::PIXEL_FORMAT_I420); | 163 EXPECT_EQ(supported_formats[1].pixel_format, media::PIXEL_FORMAT_I420); |
| 164 EXPECT_GE(supported_formats[1].frame_rate, 20); | 164 EXPECT_GE(supported_formats[1].frame_rate, 20); |
| 165 EXPECT_EQ(supported_formats[2].frame_size.width(), 1280); | 165 EXPECT_EQ(supported_formats[2].frame_size.width(), 1280); |
| 166 EXPECT_EQ(supported_formats[2].frame_size.height(), 720); | 166 EXPECT_EQ(supported_formats[2].frame_size.height(), 720); |
| 167 EXPECT_EQ(supported_formats[2].pixel_format, media::PIXEL_FORMAT_I420); | 167 EXPECT_EQ(supported_formats[2].pixel_format, media::PIXEL_FORMAT_I420); |
| 168 EXPECT_GE(supported_formats[2].frame_rate, 20); | 168 EXPECT_GE(supported_formats[2].frame_rate, 20); |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 | 171 |
| 172 TEST_F(FakeVideoCaptureDeviceTest, CaptureVariableResolution) { | 172 // Disabled, http://crbug.com/407061 . |
| 173 TEST_F(FakeVideoCaptureDeviceTest, DISABLED_CaptureVariableResolution) { |
| 173 scoped_ptr<VideoCaptureDevice::Names> names(EnumerateDevices()); | 174 scoped_ptr<VideoCaptureDevice::Names> names(EnumerateDevices()); |
| 174 | 175 |
| 175 VideoCaptureParams capture_params; | 176 VideoCaptureParams capture_params; |
| 176 capture_params.requested_format.frame_size.SetSize(640, 480); | 177 capture_params.requested_format.frame_size.SetSize(640, 480); |
| 177 capture_params.requested_format.frame_rate = 30; | 178 capture_params.requested_format.frame_rate = 30; |
| 178 capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420; | 179 capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420; |
| 179 capture_params.allow_resolution_change = true; | 180 capture_params.allow_resolution_change = true; |
| 180 | 181 |
| 181 ASSERT_GT(static_cast<int>(names->size()), 0); | 182 ASSERT_GT(static_cast<int>(names->size()), 0); |
| 182 | 183 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 199 | 200 |
| 200 // We set TimeWait to 200 action timeouts and this should be enough for at | 201 // We set TimeWait to 200 action timeouts and this should be enough for at |
| 201 // least action_count/kFakeCaptureCapabilityChangePeriod calls. | 202 // least action_count/kFakeCaptureCapabilityChangePeriod calls. |
| 202 for (int i = 0; i < action_count; ++i) { | 203 for (int i = 0; i < action_count; ++i) { |
| 203 WaitForCapturedFrame(); | 204 WaitForCapturedFrame(); |
| 204 } | 205 } |
| 205 device->StopAndDeAllocate(); | 206 device->StopAndDeAllocate(); |
| 206 } | 207 } |
| 207 | 208 |
| 208 }; // namespace media | 209 }; // namespace media |
| OLD | NEW |