1 /* 2 * Copyright (c) 2023 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 POWERMGR_SHUTDOWN_CLIENT_TEST_H 17 #define POWERMGR_SHUTDOWN_CLIENT_TEST_H 18 19 #include <gtest/gtest.h> 20 21 #include "shutdown/async_shutdown_callback_stub.h" 22 #include "shutdown/sync_shutdown_callback_stub.h" 23 #include "shutdown/takeover_shutdown_callback_stub.h" 24 25 namespace OHOS { 26 namespace PowerMgr { 27 namespace UnitTest { 28 class ShutdownClientTest : public testing::Test { 29 public: 30 class AsyncShutdownCallback : public AsyncShutdownCallbackStub { 31 public: 32 ~AsyncShutdownCallback() override = default; 33 void OnAsyncShutdown() override; 34 void OnAsyncShutdownOrReboot(bool isReboot) override; 35 }; 36 class SyncShutdownCallback : public SyncShutdownCallbackStub { 37 public: 38 ~SyncShutdownCallback() override = default; 39 void OnSyncShutdown() override; 40 void OnSyncShutdownOrReboot(bool isReboot) override; 41 }; 42 class TakeOverShutdownCallback : public TakeOverShutdownCallbackStub { 43 public: 44 ~TakeOverShutdownCallback() override = default; 45 bool OnTakeOverShutdown(bool isReboot) override; 46 }; 47 protected: 48 static void SetUpTestCase(); 49 static void TearDownTestCase(); 50 void SetUp() override; 51 void TearDown() override; 52 }; 53 } // namespace UnitTest 54 } // namespace PowerMgr 55 } // namespace OHOS 56 57 #endif // POWERMGR_SHUTDOWN_CLIENT_TEST_H