1 // Copyright (C) 2020 The Android Open Source Project 2 // 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 #pragma once 15 16 #ifdef _WIN32 17 #include <windows.h> 18 #endif 19 20 #include <stdio.h> 21 22 #include "host-common/AndroidAgentFactory.h" 23 24 namespace android { 25 namespace emulation { 26 27 // Creates a series of Mock Agents that can be used by the unit tests. 28 // 29 // Most of the agents are not defined, add your agents here if you need 30 // access to addition mock agents. They will be automatically injected 31 // at the start of the unit tests. 32 class MockAndroidConsoleFactory : public AndroidConsoleFactory { 33 public: 34 const QAndroidVmOperations* const android_get_QAndroidVmOperations() 35 const override; 36 37 const QAndroidMultiDisplayAgent* const 38 android_get_QAndroidMultiDisplayAgent() const override; 39 40 const QAndroidEmulatorWindowAgent* const 41 android_get_QAndroidEmulatorWindowAgent() const override; 42 43 44 }; 45 46 47 #ifdef _WIN32 48 // A set of flags that are only relevant for windows based unit tests 49 class WindowsFlags { 50 public: 51 static bool sIsParentProcess; 52 static HANDLE sChildRead; 53 static HANDLE sChildWrite; 54 static char sFileLockPath[MAX_PATH]; 55 }; 56 #endif 57 58 } // namespace emulation 59 } // namespace android 60