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

Side by Side Diff: media/capture/video/linux/camera_facing_chromeos_unittest.cc

Issue 2648743002: Rotate frames according to camera orientation (Closed)
Patch Set: removed {} for one-line blocks Created 3 years, 10 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <string>
6
7 #include "media/capture/video/linux/camera_facing_chromeos.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 #include <base/files/file_util.h>
11 #include <base/files/file.h>
12
13 namespace media {
14
15 namespace {
16
17 const char kConfigFileContent[] =
18 "camera0.lens_facing=1\ncamera0.sensor_orientation=0\ncamera0.module0.usb_"
19 "vid_pid=04f2:b53a\n";
20 }
21
22 TEST(CameraFacingChromeOSTest, ParseSuccessfully) {
23 const char file_name[] = "fake_camera_characteristics.conf";
24 base::WriteFile(base::FilePath(file_name), kConfigFileContent,
25 sizeof(kConfigFileContent));
26
27 std::string file_name_str(file_name);
28 CameraFacingChromeOS camera_facing(file_name_str);
29 EXPECT_EQ(VideoFacingMode::MEDIA_VIDEO_FACING_ENVIRONMENT,
30 camera_facing.GetCameraFacing(std::string("/dev/video2"),
31 std::string("04f2:b53a")));
32 }
33
34 TEST(CameraFacingChromeOSTest, ConfigFileNotExist) {
35 CameraFacingChromeOS camera_facing(std::string("file_not_exist"));
36 EXPECT_EQ(VideoFacingMode::MEDIA_VIDEO_FACING_NONE,
37 camera_facing.GetCameraFacing(std::string("/dev/video2"),
38 std::string("04f2:b53a")));
39 }
40
41 } // namespace media
OLDNEW
« no previous file with comments | « media/capture/video/linux/camera_facing_chromeos.cc ('k') | media/capture/video/linux/video_capture_device_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698