1 /* 2 * Copyright (c) 2021-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 #include <iostream> 17 #include <datetime_ex.h> 18 #include <gtest/gtest.h> 19 #include <if_system_ability_manager.h> 20 #include <ipc_skeleton.h> 21 #include <string_ex.h> 22 #include "power_reboot_test.h" 23 #include "power_common.h" 24 #include "power_mgr_client.h" 25 #include "power_mgr_service.h" 26 #include "power_state_machine.h" 27 28 using namespace testing::ext; 29 using namespace OHOS::PowerMgr; 30 using namespace OHOS; 31 using namespace std; 32 namespace { 33 /** 34 * @tc.name: RebootDeviceTest001 35 * @tc.desc: test RebootDevice in proxy 36 * @tc.type: FUNC 37 */ 38 HWTEST_F (PowerRebootTest, RebootDeviceTest001, TestSize.Level2) 39 { 40 sleep(SLEEP_WAIT_TIME_S); 41 GTEST_LOG_(INFO) << "RebootDeviceTest001: RebootDevice start."; 42 auto& powerMgrClient = PowerMgrClient::GetInstance(); 43 if (false) { 44 powerMgrClient.RebootDevice(string("RebootDeviceTest001")); 45 } 46 GTEST_LOG_(INFO) << "RebootDeviceTest001: RebootDevice end."; 47 } 48 49 /** 50 * @tc.name: RebootDeviceTest002 51 * @tc.desc: test RebootDeviceForDeprecated in proxy 52 * @tc.type: FUNC 53 */ 54 HWTEST_F (PowerRebootTest, RebootDeviceTest002, TestSize.Level2) 55 { 56 sleep(SLEEP_WAIT_TIME_S); 57 GTEST_LOG_(INFO) << "RebootDeviceTest002: RebootDeviceForDeprecated start."; 58 auto& powerMgrClient = PowerMgrClient::GetInstance(); 59 if (false) { 60 powerMgrClient.RebootDeviceForDeprecated(string("RebootDeviceTest002")); 61 } 62 GTEST_LOG_(INFO) << "RebootDeviceTest002: RebootDeviceForDeprecated end."; 63 } 64 }