1 /* 2 * Copyright (c) 2021 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_shutdown_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 33 namespace { 34 /** 35 * @tc.name: ShutDownDeviceTest001 36 * @tc.desc: test ShutDownDevice in proxy 37 * @tc.type: FUNC 38 */ 39 HWTEST_F (PowerShutdownTest, ShutDownDeviceTest001, TestSize.Level2) 40 { 41 sleep(SLEEP_WAIT_TIME_S); 42 GTEST_LOG_(INFO) << "ShutDownDeviceTest001: ShutDownDevice start."; 43 auto& powerMgrClient = PowerMgrClient::GetInstance(); 44 if (true) { 45 powerMgrClient.ShutDownDevice(string("ShutDownDeviceTest001")); 46 } 47 GTEST_LOG_(INFO) << "ShutDownDeviceTest001: ShutDownDevice end."; 48 } 49 }