• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 <gtest/gtest.h>
17 
18 #include "ability_manager_client.h"
19 #include "ability_manager_errors.h"
20 #include "ability_state_data.h"
21 #include "element_name.h"
22 #include "hilog_tag_wrapper.h"
23 #include "ipc_object_stub.h"
24 #include "start_options.h"
25 #include "status_bar_delegate_proxy.h"
26 #include "ui_extension/ui_extension_session_info.h"
27 #include "want.h"
28 
29 using namespace testing;
30 using namespace testing::ext;
31 
32 namespace OHOS {
33 namespace AAFwk {
34 
35 class AbilityManagerClientOtherTest : public testing::Test {
36 public:
37     static void SetUpTestCase();
38     static void TearDownTestCase();
39     void SetUp() override;
40     void TearDown() override;
41 };
42 
SetUpTestCase(void)43 void AbilityManagerClientOtherTest::SetUpTestCase(void)
44 {}
45 
TearDownTestCase(void)46 void AbilityManagerClientOtherTest::TearDownTestCase(void)
47 {}
48 
SetUp()49 void AbilityManagerClientOtherTest::SetUp()
50 {}
51 
TearDown()52 void AbilityManagerClientOtherTest::TearDown()
53 {}
54 
55 /**
56  * @tc.name: ForceTimeoutForTest_0100
57  * @tc.desc: OpenLink
58  * @tc.type: FUNC
59  */
60 HWTEST_F(AbilityManagerClientOtherTest, ForceTimeoutForTest_0100, TestSize.Level1)
61 {
62     TAG_LOGI(AAFwkTag::TEST, "StartSelfUIAbility_0100 start");
63     std::string abilityName = "com.example.abilityName";
64     std::string state = "com.example.state";
65     auto result = AbilityManagerClient::GetInstance()->ForceTimeoutForTest(abilityName, state);
66     EXPECT_NE(result, ERR_OK);
67     TAG_LOGI(AAFwkTag::TEST, "StartSelfUIAbility_0100 end");
68 }
69 }  // namespace AAFwk
70 }  // namespace OHOS