1 /* 2 * Copyright (c) 2022 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 LOCATOR_IMPL_TEST_H 17 #define LOCATOR_IMPL_TEST_H 18 19 #include <gtest/gtest.h> 20 21 #include "i_locator_callback.h" 22 23 #define private public 24 #define protected public 25 #include "locator_impl.h" 26 #undef protected 27 #undef private 28 29 #ifdef FEATURE_GEOCODE_SUPPORT 30 #include "geo_coding_mock_info.h" 31 #endif 32 namespace OHOS { 33 namespace Location { 34 class LocatorImplTest : public testing::Test { 35 public: 36 void SetUp(); 37 void TearDown(); 38 void MockNativePermission(); 39 void LoadSystemAbility(); 40 #ifdef FEATURE_GEOCODE_SUPPORT 41 std::vector<std::shared_ptr<GeocodingMockInfo>> SetGeocodingMockInfo(); 42 #endif 43 44 sptr<ILocatorCallback> callbackStub_; 45 std::shared_ptr<LocatorImpl> locatorImpl_; 46 uint64_t tokenId_; 47 }; 48 49 class MockCallbackResumeManager : public ICallbackResumeManager { 50 public: 51 MockCallbackResumeManager() = default; 52 ~MockCallbackResumeManager() = default; ResumeCallback()53 void ResumeCallback() override 54 { 55 return; 56 }; 57 }; 58 } // namespace Location 59 } // namespace OHOS 60 #endif // LOCATOR_IMPL_TEST_H