1/* 2 * Copyright (C) 2017 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#include "utils-fake.h" 18 19namespace android { 20namespace vintf { 21namespace details { 22 23// Do not create the mock objects here as InitGoogleMock must be called 24// first. 25FileFetcher* gFetcher = nullptr; 26 27PartitionMounter* gPartitionMounter = nullptr; 28 29ObjectFactory<RuntimeInfo>* gRuntimeInfoFactory = nullptr; 30 31MockPropertyFetcher::MockPropertyFetcher() { 32 using namespace ::testing; 33 using namespace std::placeholders; 34 ON_CALL(*this, getProperty(_, _)) 35 .WillByDefault(Invoke(std::bind(&PropertyFetcher::getProperty, real_, _1, _2))); 36} 37 38MockPropertyFetcher* gPropertyFetcher = nullptr; 39const PropertyFetcher& getPropertyFetcher() { 40 return *gPropertyFetcher; 41} 42 43} // namespace details 44} // namespace vintf 45} // namespace android 46