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

Side by Side Diff: media/video/capture/mac/video_capture_device_factory_mac_unittest.mm

Issue 1153063002: Initialize AVFoundation explicitly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add perf trace for InitializeAVFoundation and revert changes in browser_test_base.cc Created 5 years, 6 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
OLDNEW
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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "base/thread_task_runner_handle.h" 7 #include "base/thread_task_runner_handle.h"
8 #import "media/base/mac/avfoundation_glue.h" 8 #import "media/base/mac/avfoundation_glue.h"
9 #include "media/base/media_switches.h" 9 #include "media/base/media_switches.h"
10 #include "media/video/capture/mac/video_capture_device_factory_mac.h" 10 #include "media/video/capture/mac/video_capture_device_factory_mac.h"
11 #include "media/video/capture/mac/video_capture_device_mac.h" 11 #include "media/video/capture/mac/video_capture_device_mac.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace media { 14 namespace media {
15 15
16 class VideoCaptureDeviceFactoryMacTest : public testing::Test { 16 class VideoCaptureDeviceFactoryMacTest : public testing::Test {
17 void SetUp() override { 17 void SetUp() override {
18 AVFoundationGlue::InitializeAVFoundation();
18 base::CommandLine::ForCurrentProcess()->AppendSwitch( 19 base::CommandLine::ForCurrentProcess()->AppendSwitch(
19 switches::kEnableAVFoundation); 20 switches::kEnableAVFoundation);
20 } 21 }
21 22
22 private: 23 private:
23 base::MessageLoop message_loop_; 24 base::MessageLoop message_loop_;
24 }; 25 };
25 26
26 TEST_F(VideoCaptureDeviceFactoryMacTest, ListDevicesAVFoundation) { 27 TEST_F(VideoCaptureDeviceFactoryMacTest, ListDevicesAVFoundation) {
27 if (!AVFoundationGlue::IsAVFoundationSupported()) { 28 if (!AVFoundationGlue::IsAVFoundationSupported()) {
(...skipping 11 matching lines...) Expand all
39 } 40 }
40 // There should be no blacklisted devices, i.e. QTKit. 41 // There should be no blacklisted devices, i.e. QTKit.
41 std::string device_vid; 42 std::string device_vid;
42 for (VideoCaptureDevice::Names::const_iterator it = names.begin(); 43 for (VideoCaptureDevice::Names::const_iterator it = names.begin();
43 it != names.end(); ++it) { 44 it != names.end(); ++it) {
44 EXPECT_EQ(it->capture_api_type(), VideoCaptureDevice::Name::AVFOUNDATION); 45 EXPECT_EQ(it->capture_api_type(), VideoCaptureDevice::Name::AVFOUNDATION);
45 } 46 }
46 } 47 }
47 48
48 }; // namespace media 49 }; // namespace media
OLDNEW
« no previous file with comments | « media/base/mac/avfoundation_glue.mm ('k') | media/video/capture/video_capture_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698