• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "hidumper_service_test.h"
16 #include <iservice_registry.h>
17 #include "dump_manager_client.h"
18 #include "dump_manager_service.h"
19 #include "inner/dump_service_id.h"
20 using namespace std;
21 using namespace testing::ext;
22 using namespace OHOS;
23 using namespace OHOS::HiviewDFX;
24 namespace OHOS {
25 namespace HiviewDFX {
SetUpTestCase(void)26 void HidumperServiceTest::SetUpTestCase(void)
27 {
28 }
29 
TearDownTestCase(void)30 void HidumperServiceTest::TearDownTestCase(void)
31 {
32 }
33 
SetUp(void)34 void HidumperServiceTest::SetUp(void)
35 {
36 }
37 
TearDown(void)38 void HidumperServiceTest::TearDown(void)
39 {
40 }
41 
42 /**
43  * @tc.name: HidumperServiceTest001
44  * @tc.desc: Test DumpManagerService service ready.
45  * @tc.type: FUNC
46  */
47 HWTEST_F(HidumperServiceTest, HidumperServiceTest001, TestSize.Level3)
48 {
49     sptr<ISystemAbilityManager> sam = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
50     ASSERT_TRUE(sam != nullptr) << "HidumperServiceTest001 fail to get GetSystemAbilityManager";
51     sptr<IRemoteObject> remoteObject = sam->CheckSystemAbility(DFX_SYS_HIDUMPER_ABILITY_ID);
52     ASSERT_TRUE(remoteObject != nullptr) << "GetSystemAbility failed.";
53 }
54 } // namespace HiviewDFX
55 } // namespace OHOS