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

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

Issue 1215443003: [Android] Filter the unknown type in function GetDeviceSupportedFormats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-enable failing test Created 5 years, 5 months 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 | « media/video/capture/android/video_capture_device_factory_android.cc ('k') | 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/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 // Get captured video frames. 460 // Get captured video frames.
461 WaitForCapturedFrame(); 461 WaitForCapturedFrame();
462 // Verify we get MJPEG from the device. Not all devices can capture 1280x720 462 // Verify we get MJPEG from the device. Not all devices can capture 1280x720
463 // @ 30 fps, so we don't care about the exact resolution we get. 463 // @ 30 fps, so we don't care about the exact resolution we get.
464 EXPECT_EQ(last_format().pixel_format, PIXEL_FORMAT_MJPEG); 464 EXPECT_EQ(last_format().pixel_format, PIXEL_FORMAT_MJPEG);
465 EXPECT_GE(static_cast<size_t>(1280 * 720), 465 EXPECT_GE(static_cast<size_t>(1280 * 720),
466 last_format().ImageAllocationSize()); 466 last_format().ImageAllocationSize());
467 device->StopAndDeAllocate(); 467 device->StopAndDeAllocate();
468 } 468 }
469 469
470 // Fails on Android - https://crbug.com/506520. 470 TEST_F(VideoCaptureDeviceTest, GetDeviceSupportedFormats) {
471 #if defined(OS_ANDROID)
472 #define MAYBE_GetDeviceSupportedFormats DISABLED_GetDeviceSupportedFormats
473 #else
474 #define MAYBE_GetDeviceSupportedFormats GetDeviceSupportedFormats
475 #endif
476 TEST_F(VideoCaptureDeviceTest, MAYBE_GetDeviceSupportedFormats) {
477 // Use PIXEL_FORMAT_MAX to iterate all device names for testing 471 // Use PIXEL_FORMAT_MAX to iterate all device names for testing
478 // GetDeviceSupportedFormats(). 472 // GetDeviceSupportedFormats().
479 scoped_ptr<VideoCaptureDevice::Name> name = 473 scoped_ptr<VideoCaptureDevice::Name> name =
480 GetFirstDeviceNameSupportingPixelFormat(PIXEL_FORMAT_MAX); 474 GetFirstDeviceNameSupportingPixelFormat(PIXEL_FORMAT_MAX);
481 // Verify no camera returned for PIXEL_FORMAT_MAX. Nothing else to test here 475 // Verify no camera returned for PIXEL_FORMAT_MAX. Nothing else to test here
482 // since we cannot forecast the hardware capabilities. 476 // since we cannot forecast the hardware capabilities.
483 ASSERT_FALSE(name); 477 ASSERT_FALSE(name);
484 } 478 }
485 479
486 }; // namespace media 480 }; // namespace media
OLDNEW
« no previous file with comments | « media/video/capture/android/video_capture_device_factory_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698