• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2020-2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef CAMERA_LITE_TEST_H
17 #define CAMERA_LITE_TEST_H
18 
19 #include "gtest/gtest.h"
20 #include "recorder.h"
21 
22 namespace OHOS {
23 const int32_t RET_OK = 0;
24 const int32_t RET_ERR = -1;
25 const int32_t FRAME_RATE_DEFAULT = 30;
26 const int32_t OK = 0;
27 const int32_t FAIL = -1;
28 const int32_t QUEUE_SIZE = 3;
29 const int32_t BUFFER_SIZE = 1024;
30 static std::string g_filePath = "/test_root/multimedia/";
31 std::string g_testPath;
32 
33 bool g_onGetCameraAbilityFlag;
34 bool g_onConfigureFlag;
35 bool g_onGetSupportedSizesFlag;
36 // CameraDeviceCallBack Flag
37 bool g_onCameraAvailableFlag;
38 bool g_onCameraUnavailableFlag;
39 // CameraStateCallback
40 bool g_onCreatedFlag;
41 bool g_onCreateFailedFlag;
42 bool g_onReleasedFlag;
43 bool g_onConfiguredFlag;
44 bool g_onConfigureFailedFlag;
45 // FrameStateCallback
46 bool g_onCaptureTriggerAbortedFlag;
47 bool g_onCaptureTriggerCompletedFlag;
48 bool g_onCaptureTriggerStartedFlag;
49 bool g_onGetFrameConfigureType;
50 bool g_onFrameFinishedFlag;
51 bool g_onFrameErrorFlag;
52 bool g_onFrameProgressedFlag;
53 bool g_onFrameStartedFlag;
54 bool g_onRecorderFlag;
55 bool g_onPreviewFlag;
56 
57 // VideoSize
58 enum TestVideoSize {
59     WIDTH = 1920,
60     HEIGHT = 1080,
61 };
62 
63 class CameraLiteTest : public testing::Test {
64 public:
65     // SetUpTestCase: before all testcasee
66     static void SetUpTestCase(void);
67     // TearDownTestCase: after all testcase
68     static void TearDownTestCase(void);
69     // SetUp
70     void SetUp(void);
71     // TearDown
72     void TearDown(void);
73 };
74 } // namespace OHOS
75 #endif // CAMERA_LITE_TEST_H