Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Side by Side Diff: media/video/capture/video_capture_device_unittest.cc

Issue 116403002: Disable flaky VideoCaptureDeviceTest.GetDeviceSupportedFormats in Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 capture_params.allow_resolution_change = false; 354 capture_params.allow_resolution_change = false;
355 device->AllocateAndStart(capture_params, client_.PassAs<Client>()); 355 device->AllocateAndStart(capture_params, client_.PassAs<Client>());
356 // Get captured video frames. 356 // Get captured video frames.
357 WaitForCapturedFrame(); 357 WaitForCapturedFrame();
358 // Verify we get MJPEG from the device. Not all devices can capture 1280x720 358 // Verify we get MJPEG from the device. Not all devices can capture 1280x720
359 // @ 30 fps, so we don't care about the exact resolution we get. 359 // @ 30 fps, so we don't care about the exact resolution we get.
360 EXPECT_EQ(last_format().pixel_format, PIXEL_FORMAT_MJPEG); 360 EXPECT_EQ(last_format().pixel_format, PIXEL_FORMAT_MJPEG);
361 device->StopAndDeAllocate(); 361 device->StopAndDeAllocate();
362 } 362 }
363 363
364 #if defined(OS_ANDROID)
365 // TODO(mcasas): Reenable this test that is disabled in Android due to
366 // http://crbug.com/327043.
367 TEST_F(VideoCaptureDeviceTest, DISABLED_GetDeviceSupportedFormats) {
368 #else
364 TEST_F(VideoCaptureDeviceTest, GetDeviceSupportedFormats) { 369 TEST_F(VideoCaptureDeviceTest, GetDeviceSupportedFormats) {
370 #endif
365 VideoCaptureDevice::GetDeviceNames(&names_); 371 VideoCaptureDevice::GetDeviceNames(&names_);
366 if (!names_.size()) { 372 if (!names_.size()) {
367 DVLOG(1) << "No camera available. Exiting test."; 373 DVLOG(1) << "No camera available. Exiting test.";
368 return; 374 return;
369 } 375 }
370 VideoCaptureFormats supported_formats; 376 VideoCaptureFormats supported_formats;
371 VideoCaptureDevice::Names::iterator names_iterator; 377 VideoCaptureDevice::Names::iterator names_iterator;
372 for (names_iterator = names_.begin(); names_iterator != names_.end(); 378 for (names_iterator = names_.begin(); names_iterator != names_.end();
373 ++names_iterator) { 379 ++names_iterator) {
374 VideoCaptureDevice::GetDeviceSupportedFormats(*names_iterator, 380 VideoCaptureDevice::GetDeviceSupportedFormats(*names_iterator,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 EXPECT_EQ(supported_formats[0].pixel_format, media::PIXEL_FORMAT_I420); 430 EXPECT_EQ(supported_formats[0].pixel_format, media::PIXEL_FORMAT_I420);
425 EXPECT_GE(supported_formats[0].frame_rate, 20); 431 EXPECT_GE(supported_formats[0].frame_rate, 20);
426 EXPECT_EQ(supported_formats[1].frame_size.width(), 320); 432 EXPECT_EQ(supported_formats[1].frame_size.width(), 320);
427 EXPECT_EQ(supported_formats[1].frame_size.height(), 240); 433 EXPECT_EQ(supported_formats[1].frame_size.height(), 240);
428 EXPECT_EQ(supported_formats[1].pixel_format, media::PIXEL_FORMAT_I420); 434 EXPECT_EQ(supported_formats[1].pixel_format, media::PIXEL_FORMAT_I420);
429 EXPECT_GE(supported_formats[1].frame_rate, 20); 435 EXPECT_GE(supported_formats[1].frame_rate, 20);
430 } 436 }
431 } 437 }
432 438
433 }; // namespace media 439 }; // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698