• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020, The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <getopt.h>
20 #include <gtest/gtest.h>
21 #include <iostream>
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <teeui/example/example.h>
25 #include <unistd.h>
26 
27 #include <teeui/test/teeui_render_test.h>
28 
29 #define TeeuiRenderTest_DO_LOG_DEBUG
30 
31 namespace teeui {
32 
33 namespace test {
34 
35 class TeeuiRenderTest : public ::testing::Test {
36   public:
37     // Default device configuration set to Blueline
38     example::DeviceInfo device_info = {
39         1080,         // width in px
40         2160,         // height om px
41         2.62135,      // dp2px pixel per density independent pixel
42         17.42075974,  // mm2px pixel per millimeter (px/mm) ratio
43         20.26,        // distance from the top of the power button to the top of the screen in mm>
44         30.26,        // distance from the bottom of the power button to the top of the screen in mm
45         40.26,  // distance from the top of the UP volume button to the top of the screen in mm
46         50.26,  // distance from the bottom of the UP power button to the top of the screen in mm
47     };
48 
Instance()49     static TeeuiRenderTest* Instance() {
50         static TeeuiRenderTest* instance = new TeeuiRenderTest;
51         return instance;
52     }
53 
54     void initFromOptions(int argc, char** argv);
55     int runTest(const char* language, bool magnified);
TestBody()56     void TestBody() {}
57 
saveScreen()58     bool saveScreen() { return saveScreen_; }
59 
60   private:
61     bool saveScreen_ = false;
62 };
63 
64 }  // namespace test
65 
66 }  // namespace teeui
67