Chromium Code Reviews| Index: media/capture/video/linux/camera_facing_chromeos_unittest.cc |
| diff --git a/media/capture/video/linux/camera_facing_chromeos_unittest.cc b/media/capture/video/linux/camera_facing_chromeos_unittest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c293f4f226802d2f63d33b2f0307d0c6606ef679 |
| --- /dev/null |
| +++ b/media/capture/video/linux/camera_facing_chromeos_unittest.cc |
| @@ -0,0 +1,27 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include <string> |
| + |
| +#include "media/capture/video/linux/camera_facing_chromeos.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +namespace media { |
| + |
| +TEST(CameraFacingChromeOSTest, ParseSuccessfully) { |
| + CameraFacingChromeOS camera_facing( |
| + std::string("fake_camera_characteristics.conf")); |
|
mcasas
2016/12/05 18:23:19
I don't think you can access files from unittests,
shenghao
2016/12/06 10:51:28
Done.
|
| + EXPECT_EQ(CameraFacingChromeOS::LensFacing::BACK, |
| + camera_facing.GetCameraFacing(std::string("/dev/video2"), |
| + std::string("04f2:b53a"))); |
| +} |
| + |
| +TEST(CameraFacingChromeOSTest, ConfigFileNotExist) { |
| + CameraFacingChromeOS camera_facing(std::string("file_not_exist")); |
| + EXPECT_EQ(CameraFacingChromeOS::LensFacing::FRONT, |
| + camera_facing.GetCameraFacing(std::string("/dev/video2"), |
| + std::string("04f2:b53a"))); |
| +} |
| + |
| +} // namespace media |