1 /*
2 * Copyright (c) 2024 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 "dsched_continue_test.h"
17
18 #include "distributed_sched_service.h"
19 #include "dsched_continue.h"
20 #include "dtbschedmgr_log.h"
21 #include "softbus_error_code.h"
22 #include "test_log.h"
23 #include "mission/distributed_bm_storage.h"
24 #include "continue_scene_session_handler.h"
25
26 using namespace testing;
27 using namespace testing::ext;
28
29 namespace OHOS {
30 namespace DistributedSchedule {
31 using namespace AAFwk;
32 namespace {
33 const std::string BASEDIR = "/data/service/el1/public/database/DistributedSchedule";
34 const std::string BUNDLEMAME_1 = "bundleName";
35 const std::string CONTINUE_TYPE1 = "continueType1";
36 const std::string CONTINUE_TYPE2 = "continueType2";
37 const std::string CONTINUE_TYPE3 = "continueType3";
38 const std::string CONTINUE_TYPE1_QUICK = "continueType1_ContinueQuickStart";
39 const std::string MODULE_NAME1 = "moduleName1";
40 const std::string MODULE_NAME2 = "moduleName2";
41 const std::string MODULE_NAME3 = "moduleName3";
42 const std::string ABILITY_NAME_SAME_AS_CONTINUE_TYPE = CONTINUE_TYPE1;
43 const std::string ABILITY_NAME_DIFF_AS_CONTINUE_TYPE = "ability";
44 const int32_t WAITTIME = 2000;
45 const uint32_t DSCHED_BUFFER_SIZE = 1024;
46 }
SetUpTestCase()47 void DSchedContinueTest::SetUpTestCase()
48 {
49 mkdir(BASEDIR.c_str(), (S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH));
50 dmsStoreMock = std::make_shared<MockDmsMgrDeviceInfoStore>();
51 DmsMgrDeviceInfoStore::dmsStore = dmsStoreMock;
52 clientMock_ = std::make_shared<AbilityManagerClientMock>();
53 AbilityManagerClientMock::clientMock = clientMock_;
54 DTEST_LOG << "DSchedContinueTest::SetUpTestCase" << std::endl;
55 DistributedSchedService::GetInstance().Init();
56
57 std::string deviceId = "123";
58 std::string bundleName = "test";
59 int32_t subType = CONTINUE_PULL;
60 int32_t direction = CONTINUE_SINK;
61 sptr<IRemoteObject> callback = nullptr;
62 OHOS::AAFwk::WantParams wantParams;
63 auto info = DSchedContinueInfo(deviceId, bundleName, deviceId, bundleName, "");
64 conti_ = std::make_shared<DSchedContinue>(subType, direction, callback, info);
65
66 conti_->Init();
67 usleep(WAITTIME);
68 }
69
TearDownTestCase()70 void DSchedContinueTest::TearDownTestCase()
71 {
72 (void)remove(BASEDIR.c_str());
73 DmsMgrDeviceInfoStore::dmsStore = nullptr;
74 dmsStoreMock = nullptr;
75 AbilityManagerClientMock::clientMock = nullptr;
76 clientMock_ = nullptr;
77 DTEST_LOG << "DSchedContinueTest::TearDownTestCase" << std::endl;
78 conti_ = nullptr;
79 }
80
TearDown()81 void DSchedContinueTest::TearDown()
82 {
83 usleep(WAITTIME);
84 DTEST_LOG << "DSchedContinueTest::TearDown" << std::endl;
85 }
86
SetUp()87 void DSchedContinueTest::SetUp()
88 {
89 usleep(WAITTIME);
90 DTEST_LOG << "DSchedContinueTest::SetUp" << std::endl;
91 }
92
93 /**
94 * @tc.name: DSchedContinueTest_001_1
95 * @tc.desc: OnContinueMission and PostStartTask
96 * @tc.type: FUNC
97 */
98 HWTEST_F(DSchedContinueTest, DSchedContinueTest_001_1, TestSize.Level1)
99 {
100 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_001_1 begin" << std::endl;
101 ASSERT_NE(conti_, nullptr);
102 ASSERT_NE(conti_->eventHandler_, nullptr);
103
104 // eventHandler_ not null
105 OHOS::AAFwk::WantParams wantParams;
106 auto ret = conti_->PostStartTask(wantParams);
107 EXPECT_EQ(ret, ERR_OK);
108 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_001_1 end ret:" << ret << std::endl;
109 }
110
111 /**
112 * @tc.name: DSchedContinueTest_002_1
113 * @tc.desc: OnStartCmd and PostCotinueAbilityTask
114 * @tc.type: FUNC
115 */
116 HWTEST_F(DSchedContinueTest, DSchedContinueTest_002_1, TestSize.Level1)
117 {
118 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_002_1 begin" << std::endl;
119 ASSERT_NE(conti_, nullptr);
120 ASSERT_NE(conti_->eventHandler_, nullptr);
121
122 // eventHandler_ not null
123 int32_t appVersion = 0;
124 auto ret = conti_->PostCotinueAbilityTask(appVersion);
125 EXPECT_EQ(ret, ERR_OK);
126 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_002_1 end ret:" << ret << std::endl;
127 }
128
129 /**
130 * @tc.name: DSchedContinueTest_003
131 * @tc.desc: OnReplyCmd and PostReplyTask
132 * @tc.type: FUNC
133 */
134 HWTEST_F(DSchedContinueTest, DSchedContinueTest_003_1, TestSize.Level1)
135 {
136 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_003_1 begin" << std::endl;
137 // eventHandler_ not null
138 ASSERT_NE(conti_, nullptr);
139 ASSERT_NE(conti_->eventHandler_, nullptr);
140 auto cmd = std::make_shared<DSchedContinueReplyCmd>();
141 cmd->replyCmd_ = DSCHED_CONTINUE_END_EVENT;
142 auto ret = conti_->OnReplyCmd(cmd);
143 EXPECT_EQ(ret, ERR_OK);
144
145 ret = conti_->PostReplyTask(cmd);
146 EXPECT_EQ(ret, ERR_OK);
147
148 cmd->replyCmd_ = DSCHED_CONTINUE_INVALID_EVENT;
149 ret = conti_->PostReplyTask(cmd);
150 EXPECT_EQ(ret, ERR_OK);
151
152 cmd = nullptr;
153 ret = conti_->PostReplyTask(cmd);
154 EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
155 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_003_1 end ret:" << ret << std::endl;
156 }
157
158 /**
159 * @tc.name: DSchedContinueTest_004_1
160 * @tc.desc: OnStartContinuation and PostContinueSendTask
161 * @tc.type: FUNC
162 */
163 HWTEST_F(DSchedContinueTest, DSchedContinueTest_004_1, TestSize.Level1)
164 {
165 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_004_1 begin" << std::endl;
166 OHOS::AAFwk::Want want;
167 int32_t callerUid = 0;
168 int32_t status = ERR_OK;
169 uint32_t accessToken = 0;
170
171 // eventHandler_ not null
172 ASSERT_NE(conti_, nullptr);
173 ASSERT_NE(conti_->eventHandler_, nullptr);
174
175 auto ret = conti_->OnStartContinuation(want, callerUid, status, accessToken);
176 EXPECT_EQ(ret, ERR_OK);
177
178 ret = conti_->PostContinueSendTask(want, callerUid, status, accessToken);
179 EXPECT_EQ(ret, ERR_OK);
180
181 status = ERR_NONE;
182 ret = conti_->PostContinueSendTask(want, callerUid, status, accessToken);
183 EXPECT_EQ(ret, ERR_OK);
184 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_004_1 end ret:" << ret << std::endl;
185 }
186
187 /**
188 * @tc.name: DSchedContinueTest_005
189 * @tc.desc: OnContinueDataCmd and PostContinueDataTask
190 * @tc.type: FUNC
191 */
192 HWTEST_F(DSchedContinueTest, DSchedContinueTest_005_1, TestSize.Level1)
193 {
194 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_005_1 begin" << std::endl;
195 // eventHandler_ not null
196 ASSERT_NE(conti_, nullptr);
197 ASSERT_NE(conti_->eventHandler_, nullptr);
198 auto cmd = std::make_shared<DSchedContinueDataCmd>();
199 auto ret = conti_->OnContinueDataCmd(cmd);
200 EXPECT_EQ(ret, ERR_OK);
201
202 ret = conti_->PostContinueDataTask(cmd);
203 EXPECT_EQ(ret, ERR_OK);
204 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_005_1 end ret:" << ret << std::endl;
205 }
206
207 /**
208 * @tc.name: DSchedContinueTest_006_1
209 * @tc.desc: OnNotifyComplete, OnContinueEndCmd and PostNotifyCompleteTask
210 * @tc.type: FUNC
211 */
212 HWTEST_F(DSchedContinueTest, DSchedContinueTest_006_1, TestSize.Level1)
213 {
214 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_006_1 begin" << std::endl;
215 // eventHandler_ not null
216 ASSERT_NE(conti_, nullptr);
217 ASSERT_NE(conti_->eventHandler_, nullptr);
218 auto cmd = std::make_shared<DSchedContinueEndCmd>();
219 auto ret = conti_->PostNotifyCompleteTask(ERR_OK);
220 EXPECT_EQ(ret, ERR_OK);
221
222 cmd = nullptr;
223 ret = conti_->OnContinueEndCmd(cmd);
224 EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
225 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_006_1 end ret:" << ret << std::endl;
226 }
227
228 /**
229 * @tc.name: DSchedContinueTest_007_1
230 * @tc.desc: OnContinueEnd and PostContinueEndTask
231 * @tc.type: FUNC
232 */
233 HWTEST_F(DSchedContinueTest, DSchedContinueTest_007_1, TestSize.Level1)
234 {
235 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_007_1 begin" << std::endl;
236 ASSERT_NE(conti_, nullptr);
237 ASSERT_NE(conti_->eventHandler_, nullptr);
238 int32_t result = ERR_OK;
239 auto ret = conti_->PostContinueEndTask(result);
240 EXPECT_EQ(ret, ERR_OK);
241
242 // result is CONTINUE_SINK_ABILITY_TERMINATED
243 result = CONTINUE_SINK_ABILITY_TERMINATED;
244 conti_->UpdateState(DSCHED_CONTINUE_SINK_WAIT_END_STATE);
245 ret = conti_->OnContinueEnd(result);
246 EXPECT_EQ(ret, ERR_OK);
247 conti_->UpdateState(DSCHED_CONTINUE_SINK_END_STATE);
248 ret = conti_->OnContinueEnd(result);
249 EXPECT_EQ(ret, ERR_OK);
250 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_007_1 end ret:" << ret << std::endl;
251 }
252
253 /**
254 * @tc.name: DSchedContinueTest_008_1
255 * @tc.desc: ExecuteContinueReq
256 * @tc.type: FUNC
257 */
258 HWTEST_F(DSchedContinueTest, DSchedContinueTest_008_1, TestSize.Level1)
259 {
260 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_008_1 begin" << std::endl;
261 ASSERT_NE(conti_, nullptr);
262 ASSERT_NE(conti_->eventHandler_, nullptr);
263 auto wantParams = std::make_shared<DistributedWantParams>();
264 int32_t ret = conti_->ExecuteContinueReq(wantParams);
265 EXPECT_NE(ret, ERR_OK);
266 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_008_1 end ret:" << ret << std::endl;
267 }
268
269 /**
270 * @tc.name: DSchedContinueTest_009_1
271 * @tc.desc: PackStartCmd
272 * @tc.type: FUNC
273 */
274 HWTEST_F(DSchedContinueTest, DSchedContinueTest_009_1, TestSize.Level1)
275 {
276 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_009_1 begin" << std::endl;
277 ASSERT_NE(conti_, nullptr);
278 ASSERT_NE(conti_->eventHandler_, nullptr);
279 auto cmd = std::make_shared<DSchedContinueStartCmd>();
280 auto wantParams = std::make_shared<DistributedWantParams>();
281
282 conti_->subServiceType_ = CONTINUE_PUSH;
283 int32_t ret = conti_->PackStartCmd(cmd, wantParams);
284 EXPECT_EQ(ret, ERR_OK);
285
286 wantParams = nullptr;
287 ret = conti_->PackStartCmd(cmd, wantParams);
288 EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
289
290 wantParams = std::make_shared<DistributedWantParams>();
291 conti_->continueInfo_.missionId_ = 0;
292 EXPECT_NE(ret, ERR_OK);
293 conti_->subServiceType_ = CONTINUE_PULL;
294 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_009_1 end ret:" << ret << std::endl;
295 }
296
297 /**
298 * @tc.name: DSchedContinueTest_0010_1
299 * @tc.desc: ExecuteContinueAbility
300 * @tc.type: FUNC
301 */
302 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0010_1, TestSize.Level1)
303 {
304 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0010_1 begin" << std::endl;
305 ASSERT_NE(conti_, nullptr);
306 ASSERT_NE(conti_->eventHandler_, nullptr);
307 int32_t appVersion = 0;
308 int32_t ret = conti_->ExecuteContinueAbility(appVersion);
309 EXPECT_NE(ret, ERR_OK);
310 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0010_1 end ret:" << ret << std::endl;
311 }
312
313 /**
314 * @tc.name: DSchedContinueTest_0011_1
315 * @tc.desc: GetMissionIdByBundleName
316 * @tc.type: FUNC
317 */
318 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0011_1, TestSize.Level1)
319 {
320 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0011_1 begin" << std::endl;
321 ASSERT_NE(conti_, nullptr);
322 ASSERT_NE(conti_->eventHandler_, nullptr);
323 int32_t ret = conti_->GetMissionIdByBundleName();
324 #ifdef SUPPORT_DISTRIBUTED_MISSION_MANAGER
325 EXPECT_EQ(ret, MISSION_NOT_FOCUSED);
326 #else
327 EXPECT_EQ(ret, ERR_OK);
328 #endif
329 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0011_1 end ret:" << ret << std::endl;
330 }
331
332 /**
333 * @tc.name: DSchedContinueTest_0012_1
334 * @tc.desc: CheckContinueAbilityPermission
335 * @tc.type: FUNC
336 */
337 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0012_1, TestSize.Level1)
338 {
339 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0012_1 begin" << std::endl;
340 ASSERT_NE(conti_, nullptr);
341 ASSERT_NE(conti_->eventHandler_, nullptr);
342 EXPECT_CALL(*clientMock_, GetMissionInfo(_, _, _)).WillOnce(Return(1));
343 int32_t ret = conti_->CheckContinueAbilityPermission();
344 EXPECT_EQ(ret, NO_MISSION_INFO_FOR_MISSION_ID);
345 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0012_1 end ret:" << ret << std::endl;
346 }
347
348 /**
349 * @tc.name: DSchedContinueTest_0013_1
350 * @tc.desc: ExecuteContinueReply
351 * @tc.type: FUNC
352 */
353 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0013_1, TestSize.Level1)
354 {
355 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0013_1 begin" << std::endl;
356 ASSERT_NE(conti_, nullptr);
357 ASSERT_NE(conti_->eventHandler_, nullptr);
358 int32_t ret = conti_->ExecuteContinueReply();
359 EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
360 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0013_1 end ret:" << ret << std::endl;
361 }
362
363 /**
364 * @tc.name: DSchedContinueTest_0014_1
365 * @tc.desc: ExecuteContinueSend
366 * @tc.type: FUNC
367 */
368 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0014_1, TestSize.Level1)
369 {
370 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0014_1 begin" << std::endl;
371 ASSERT_NE(conti_, nullptr);
372 ASSERT_NE(conti_->eventHandler_, nullptr);
373 auto data = std::make_shared<ContinueAbilityData>();
374 int32_t ret = conti_->ExecuteContinueSend(data);
375 EXPECT_EQ(ret, INVALID_REMOTE_PARAMETERS_ERR);
376
377 data = nullptr;
378 ret = conti_->ExecuteContinueSend(data);
379 EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
380 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0014_1 end ret:" << ret << std::endl;
381 }
382
383 /**
384 * @tc.name: DSchedContinueTest_0015_1
385 * @tc.desc: SetWantForContinuation
386 * @tc.type: FUNC
387 */
388 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0015_1, TestSize.Level1)
389 {
390 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0015_1 begin" << std::endl;
391 ASSERT_NE(conti_, nullptr);
392 ASSERT_NE(conti_->eventHandler_, nullptr);
393 AAFwk::Want want;
394 int32_t ret = conti_->SetWantForContinuation(want);
395 EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
396 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0015_1 end ret:" << ret << std::endl;
397 usleep(WAITTIME);
398 }
399
400 /**
401 * @tc.name: DSchedContinueTest_0016_1
402 * @tc.desc: PackDataCmd
403 * @tc.type: FUNC
404 */
405 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0016_1, TestSize.Level1)
406 {
407 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0016_1 begin" << std::endl;
408 ASSERT_NE(conti_, nullptr);
409 ASSERT_NE(conti_->eventHandler_, nullptr);
410 auto cmd = std::make_shared<DSchedContinueDataCmd>();
411 OHOS::AAFwk::Want want;
412 AppExecFwk::AbilityInfo abilityInfo;
413 CallerInfo callerInfo;
414 AccountInfo accountInfo;
415
416 int32_t ret = conti_->PackDataCmd(cmd, want, abilityInfo, callerInfo, accountInfo);
417 EXPECT_EQ(ret, ERR_OK);
418
419 cmd = nullptr;
420 ret = conti_->PackDataCmd(cmd, want, abilityInfo, callerInfo, accountInfo);
421 EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
422 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0016_1 end ret:" << ret << std::endl;
423 }
424
425 /**
426 * @tc.name: DSchedContinueTest_0017_1
427 * @tc.desc: ExecuteContinueData
428 * @tc.type: FUNC
429 */
430 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0017_1, TestSize.Level1)
431 {
432 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0017_1 begin" << std::endl;
433 ASSERT_NE(conti_, nullptr);
434 ASSERT_NE(conti_->eventHandler_, nullptr);
435 auto cmd = std::make_shared<DSchedContinueDataCmd>();
436
437 EXPECT_CALL(*dmsStoreMock, GetLocalDeviceId(_)).WillOnce(Return(true)).WillOnce(Return(true));
438 int32_t ret = conti_->ExecuteContinueData(cmd);
439 EXPECT_EQ(ret, INVALID_REMOTE_PARAMETERS_ERR);
440
441 cmd = nullptr;
442 ret = conti_->ExecuteContinueData(cmd);
443 EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
444 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0017_1 end ret:" << ret << std::endl;
445 }
446
447 /**
448 * @tc.name: DSchedContinueTest_0017_2
449 * @tc.desc: UpdateElementInfo
450 * @tc.type: FUNC
451 */
452 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0017_2, TestSize.Level1)
453 {
454 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0017_2 begin" << std::endl;
455 ASSERT_NE(conti_, nullptr);
456 ASSERT_NE(conti_->eventHandler_, nullptr);
457 auto cmd = std::make_shared<DSchedContinueDataCmd>();
458 // no same continueType, diff module
459 EXPECT_CALL(*dmsStoreMock, GetLocalDeviceId(_)).WillOnce(Return(true));
460 cmd->continueType_ = CONTINUE_TYPE3;
461 cmd->want_.SetElementName("", BUNDLEMAME_1, ABILITY_NAME_SAME_AS_CONTINUE_TYPE, MODULE_NAME2);
462 int32_t ret = conti_->UpdateElementInfo(cmd);
463 EXPECT_EQ(ret, CAN_NOT_FOUND_MODULE_ERR);
464 // no continueType, same module
465 EXPECT_CALL(*dmsStoreMock, GetLocalDeviceId(_)).WillOnce(Return(true));
466 cmd->continueType_ = CONTINUE_TYPE1;
467 cmd->want_.SetElementName("", BUNDLEMAME_1, ABILITY_NAME_SAME_AS_CONTINUE_TYPE, MODULE_NAME1);
468 ret = conti_->UpdateElementInfo(cmd);
469 EXPECT_EQ(ret, ERR_OK);
470 // no continueType with quick start, same module
471 EXPECT_CALL(*dmsStoreMock, GetLocalDeviceId(_)).WillOnce(Return(true));
472 cmd->continueType_ = CONTINUE_TYPE1_QUICK;
473 cmd->want_.SetElementName("", BUNDLEMAME_1, ABILITY_NAME_SAME_AS_CONTINUE_TYPE, MODULE_NAME1);
474 ret = conti_->UpdateElementInfo(cmd);
475 EXPECT_EQ(ret, ERR_OK);
476 // has continueType, same module
477 EXPECT_CALL(*dmsStoreMock, GetLocalDeviceId(_)).WillOnce(Return(true));
478 cmd->continueType_ = CONTINUE_TYPE2;
479 cmd->want_.SetElementName("", BUNDLEMAME_1, ABILITY_NAME_DIFF_AS_CONTINUE_TYPE, MODULE_NAME2);
480 ret = conti_->UpdateElementInfo(cmd);
481 EXPECT_EQ(ret, ERR_OK);
482 // has continueType, diff module
483 EXPECT_CALL(*dmsStoreMock, GetLocalDeviceId(_)).WillOnce(Return(true));
484 cmd->continueType_ = CONTINUE_TYPE2;
485 cmd->want_.SetElementName("", BUNDLEMAME_1, ABILITY_NAME_DIFF_AS_CONTINUE_TYPE, MODULE_NAME1);
486 ret = conti_->UpdateElementInfo(cmd);
487 EXPECT_EQ(ret, ERR_OK);
488 // has continueType, no module
489 EXPECT_CALL(*dmsStoreMock, GetLocalDeviceId(_)).WillOnce(Return(true));
490 cmd->continueType_ = CONTINUE_TYPE2;
491 cmd->want_.SetElementName("", BUNDLEMAME_1, ABILITY_NAME_DIFF_AS_CONTINUE_TYPE, MODULE_NAME3);
492 ret = conti_->UpdateElementInfo(cmd);
493 EXPECT_EQ(ret, ERR_OK);
494 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0017_2 end ret:" << ret << std::endl;
495 usleep(WAITTIME);
496 }
497
GetDistributedBundleInfo(const std::string & networkId,const std::string & bundleName,DmsBundleInfo & distributeBundleInfo)498 bool DmsBmStorage::GetDistributedBundleInfo(const std::string &networkId, const std::string &bundleName,
499 DmsBundleInfo &distributeBundleInfo)
500 {
501 DmsAbilityInfo info2;
502 info2.continueType = {CONTINUE_TYPE2};
503 info2.moduleName = MODULE_NAME2;
504 info2.abilityName = ABILITY_NAME_DIFF_AS_CONTINUE_TYPE;
505 distributeBundleInfo.dmsAbilityInfos.push_back(info2);
506
507 DmsAbilityInfo info1;
508 info1.continueType = {CONTINUE_TYPE1};
509 info1.moduleName = MODULE_NAME1;
510 info1.abilityName = ABILITY_NAME_SAME_AS_CONTINUE_TYPE;
511 distributeBundleInfo.dmsAbilityInfos.push_back(info1);
512 return true;
513 }
514
515 /**
516 * @tc.name: DSchedContinueTest_0018_1
517 * @tc.desc: ExecuteNotifyComplete
518 * @tc.type: FUNC
519 */
520 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0018_1, TestSize.Level1)
521 {
522 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0018_1 begin" << std::endl;
523 ASSERT_NE(conti_, nullptr);
524 ASSERT_NE(conti_->eventHandler_, nullptr);
525
526 int32_t result = ERR_OK;
527 int32_t ret = conti_->ExecuteNotifyComplete(result);
528 EXPECT_NE(ret, ERR_OK);
529
530 conti_->direction_ = CONTINUE_SOURCE;
531 ret = conti_->ExecuteNotifyComplete(result);
532 EXPECT_NE(ret, ERR_OK);
533 conti_->direction_ = CONTINUE_SINK;
534 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0018_1 end ret:" << ret << std::endl;
535 }
536
537 /**
538 * @tc.name: DSchedContinueTest_0019_1
539 * @tc.desc: PackReplyCmd
540 * @tc.type: FUNC
541 */
542 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0019_1, TestSize.Level1)
543 {
544 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0019_1 begin" << std::endl;
545 ASSERT_NE(conti_, nullptr);
546 ASSERT_NE(conti_->eventHandler_, nullptr);
547 auto cmd = std::make_shared<DSchedContinueReplyCmd>();
548 int32_t replyCmd = 0;
549 int32_t appVersion = 0;
550 int32_t result = 0;
551
552 int32_t ret = conti_->PackReplyCmd(cmd, replyCmd, appVersion, result, "");
553 EXPECT_EQ(ret, ERR_OK);
554
555 cmd = nullptr;
556 ret = conti_->PackReplyCmd(cmd, replyCmd, appVersion, result, "");
557 EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
558 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0019_1 end ret:" << ret << std::endl;
559 }
560
561 /**
562 * @tc.name: DSchedContinueTest_0020_1
563 * @tc.desc: ExecuteContinueEnd
564 * @tc.type: FUNC
565 */
566 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0020_1, TestSize.Level1)
567 {
568 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0020_1 begin" << std::endl;
569 ASSERT_NE(conti_, nullptr);
570 ASSERT_NE(conti_->eventHandler_, nullptr);
571 int32_t result = 0;
572
573 int32_t ret = conti_->ExecuteContinueEnd(result);
574 EXPECT_EQ(ret, ERR_OK);
575 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0020_1 end ret:" << ret << std::endl;
576 }
577
578 /**
579 * @tc.name: DSchedContinueTest_0021_1
580 * @tc.desc: ExecuteContinueError
581 * @tc.type: FUNC
582 */
583 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0021_1, TestSize.Level1)
584 {
585 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0021_1 begin" << std::endl;
586 ASSERT_NE(conti_, nullptr);
587 ASSERT_NE(conti_->eventHandler_, nullptr);
588 int32_t result = 0;
589 int32_t ret = conti_->ExecuteContinueError(result);
590 EXPECT_EQ(ret, ERR_OK);
591
592 conti_->direction_ = CONTINUE_SOURCE;
593 ret = conti_->ExecuteContinueError(result);
594 EXPECT_EQ(ret, ERR_OK);
595 conti_->direction_ = CONTINUE_SINK;
596 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0021_1 end ret:" << ret << std::endl;
597 }
598
599 /**
600 * @tc.name: DSchedContinueTest_0022_1
601 * @tc.desc: PackEndCmd
602 * @tc.type: FUNC
603 */
604 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0022_1, TestSize.Level1)
605 {
606 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0022_1 begin" << std::endl;
607 ASSERT_NE(conti_, nullptr);
608 ASSERT_NE(conti_->eventHandler_, nullptr);
609 auto cmd = std::make_shared<DSchedContinueEndCmd>();
610 int32_t result = 0;
611
612 int32_t ret = conti_->PackEndCmd(cmd, result);
613 EXPECT_EQ(ret, ERR_OK);
614
615 cmd = nullptr;
616 ret = conti_->PackEndCmd(cmd, result);
617 EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
618 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0022_1 end ret:" << ret << std::endl;
619 }
620
621 /**
622 * @tc.name: DSchedContinueTest_0023_1
623 * @tc.desc: SendCommand
624 * @tc.type: FUNC
625 */
626 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0023_1, TestSize.Level1)
627 {
628 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0023_1 begin" << std::endl;
629 ASSERT_NE(conti_, nullptr);
630 ASSERT_NE(conti_->eventHandler_, nullptr);
631 auto cmd = std::make_shared<DSchedContinueCmdBase>();
632 int32_t ret = conti_->SendCommand(cmd);
633 EXPECT_NE(ret, ERR_OK);
634 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0023_1 end ret:" << ret << std::endl;
635 }
636
637 /**
638 * @tc.name: DSchedContinueTest_0024_1
639 * @tc.desc: GetLocalDeviceId
640 * @tc.type: FUNC
641 */
642 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0024_1, TestSize.Level1)
643 {
644 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0024_1 begin" << std::endl;
645 ASSERT_NE(conti_, nullptr);
646 ASSERT_NE(conti_->eventHandler_, nullptr);
647 std::string localDeviceId;
648 EXPECT_CALL(*dmsStoreMock, GetLocalDeviceId(_)).WillOnce(Return(true));
649 bool ret = conti_->GetLocalDeviceId(localDeviceId);
650 EXPECT_EQ(ret, true);
651 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0024_1 end ret:" << ret << std::endl;
652 }
653
654 /**
655 * @tc.name: DSchedContinueTest_0025_1
656 * @tc.desc: CheckDeviceIdFromRemote
657 * @tc.type: FUNC
658 */
659 HWTEST_F(DSchedContinueTest, DSchedContinueTest_0025_1, TestSize.Level1)
660 {
661 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0025_1 begin" << std::endl;
662 ASSERT_NE(conti_, nullptr);
663 ASSERT_NE(conti_->eventHandler_, nullptr);
664 bool ret = conti_->CheckDeviceIdFromRemote("", "", "");
665 EXPECT_FALSE(ret);
666
667 std::string localDevId = "localDevId";
668 std::string destDevId = "destDevId";
669 std::string srcDevId = "srcDevId";
670 ret = conti_->CheckDeviceIdFromRemote(localDevId, destDevId, srcDevId);
671 EXPECT_FALSE(ret);
672
673 destDevId = "localDevId";
674 srcDevId = "localDevId";
675 ret = conti_->CheckDeviceIdFromRemote(localDevId, destDevId, srcDevId);
676 EXPECT_FALSE(ret);
677
678 conti_->continueInfo_.sourceDeviceId_ = "localDevId";
679 ret = conti_->CheckDeviceIdFromRemote(localDevId, destDevId, srcDevId);
680 EXPECT_FALSE(ret);
681
682 srcDevId = "srcDevId";
683 conti_->continueInfo_.sourceDeviceId_ = "srcDevId";
684 ret = conti_->CheckDeviceIdFromRemote(localDevId, destDevId, srcDevId);
685 EXPECT_TRUE(ret);
686 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_0025_1 end ret:" << ret << std::endl;
687 }
688
689 /**
690 * @tc.name: WaitAbilityStateInitialTest_0026_1
691 * @tc.desc: WaitAbilityStateInitialTest
692 * @tc.type: FUNC
693 */
694 HWTEST_F(DSchedContinueTest, WaitAbilityStateInitialTest_0026_1, TestSize.Level1)
695 {
696 DTEST_LOG << "DSchedContinueTest WaitAbilityStateInitialTest_0026_1 begin" << std::endl;
697 ASSERT_NE(conti_, nullptr);
698 ASSERT_NE(conti_->eventHandler_, nullptr);
699 int32_t persistentId = 100;
700 EXPECT_CALL(*clientMock_, GetAbilityStateByPersistentId(_, _)).WillRepeatedly(Return(0));
701 bool ret = conti_->WaitAbilityStateInitial(persistentId);
702 EXPECT_FALSE(ret);
703 DTEST_LOG << "DSchedContinueTest WaitAbilityStateInitialTest_0026_1 end ret:" << ret << std::endl;
704 }
705
706 /**
707 * @tc.name: StartAbilityTest_0027_1
708 * @tc.desc: StartAbilityTest
709 * @tc.type: FUNC
710 */
711 HWTEST_F(DSchedContinueTest, StartAbilityTest_0027_1, TestSize.Level1)
712 {
713 DTEST_LOG << "DSchedContinueTest StartAbilityTest_0027_1 begin" << std::endl;
714 ASSERT_NE(conti_, nullptr);
715 ASSERT_NE(conti_->eventHandler_, nullptr);
716 AAFwk::Want want;
717 AppExecFwk::ElementName element("devicdId", "com.ohos.distributedmusicplayer",
718 "com.ohos.distributedmusicplayer.MainAbility");
719 want.SetElement(element);
720 EXPECT_CALL(*clientMock_, Connect()).WillOnce(Return(0));
721 EXPECT_CALL(*clientMock_, StartAbility(_, _, _)).WillOnce(Return(1));
722 int32_t ret = conti_->StartAbility(want, 0);
723 EXPECT_NE(ret, ERR_OK);
724 DTEST_LOG << "DSchedContinueTest StartAbilityTest_0027_1 end ret:" << ret << std::endl;
725 }
726
727 /**
728 * @tc.name: QuerySinkAbilityNameTest_0028_1
729 * @tc.desc: QuerySinkAbilityNameTest
730 * @tc.type: FUNC
731 */
732 HWTEST_F(DSchedContinueTest, QuerySinkAbilityNameTest_0028_1, TestSize.Level1)
733 {
734 DTEST_LOG << "DSchedContinueTest QuerySinkAbilityNameTest_0028_1 begin" << std::endl;
735 ASSERT_NE(conti_, nullptr);
736 ASSERT_NE(conti_->eventHandler_, nullptr);
737 std::string sinkBundleName = conti_->QuerySinkAbilityName();
738 EXPECT_TRUE(sinkBundleName.empty());
739 DTEST_LOG << "DSchedContinueTest QuerySinkAbilityNameTest_0028_1 end" << std::endl;
740 }
741
742 /**
743 * @tc.name: QuickStartAbilityTest_0029_1
744 * @tc.desc: QuickStartAbilityTest
745 * @tc.type: FUNC
746 */
747 HWTEST_F(DSchedContinueTest, QuickStartAbilityTest_0029_1, TestSize.Level1)
748 {
749 DTEST_LOG << "DSchedContinueTest QuickStartAbilityTest_0029_1 begin" << std::endl;
750 ASSERT_NE(conti_, nullptr);
751 ASSERT_NE(conti_->eventHandler_, nullptr);
752 int32_t ret = conti_->QuickStartAbility();
753 EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
754 DTEST_LOG << "DSchedContinueTest QuickStartAbilityTest_0029_1 end ret:" << ret << std::endl;
755 }
756
757 /**
758 * @tc.name: UpdateWantForContinueTypeTest_0030_1
759 * @tc.desc: UpdateWantForContinueTypeTest
760 * @tc.type: FUNC
761 */
762 HWTEST_F(DSchedContinueTest, UpdateWantForContinueTypeTest_0030_1, TestSize.Level1)
763 {
764 DTEST_LOG << "DSchedContinueTest UpdateWantForContinueTypeTest_0030_1 begin" << std::endl;
765 ASSERT_NE(conti_, nullptr);
766 ASSERT_NE(conti_->eventHandler_, nullptr);
767 AAFwk::Want want;
768 AppExecFwk::ElementName element("devicdId", "com.ohos.distributedmusicplayer",
769 "com.ohos.distributedmusicplayer.MainAbility");
770 want.SetElement(element);
771 int32_t ret = conti_->UpdateWantForContinueType(want);
772 EXPECT_EQ(ret, ERR_OK);
773 DTEST_LOG << "DSchedContinueTest UpdateWantForContinueTypeTest_0030_1 end ret:" << ret << std::endl;
774 }
775
776 /**
777 * @tc.name: DSchedContinueTest_031_1
778 * @tc.desc: DSchedContinue
779 * @tc.type: FUNC
780 */
781 HWTEST_F(DSchedContinueTest, DSchedContinueTest_031_1, TestSize.Level1)
782 {
783 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_031_1 begin" << std::endl;
784 ASSERT_NE(conti_, nullptr);
785 ASSERT_NE(conti_->eventHandler_, nullptr);
786 AppExecFwk::InnerEvent *event = nullptr;
__anonc10934e10202(AppExecFwk::InnerEvent *event) 787 auto destructor = [](AppExecFwk::InnerEvent *event) {
788 if (event != nullptr) {
789 delete event;
790 }
791 };
792 conti_->ProcessEvent(AppExecFwk::InnerEvent::Pointer(event, destructor));
793 conti_->continueInfo_.continueType_ = "";
794 conti_->CheckQuickStartConfiguration();
795 conti_->GetSessionId();
796 conti_->GetAbilityNameByContinueType();
797 EXPECT_NE(nullptr, conti_->stateMachine_);
798 DTEST_LOG << "DSchedContinueTest DSchedContinueTest_031_1 end" << std::endl;
799 }
800
801 /**
802 * @tc.name: OnDataRecvTest_032_1
803 * @tc.desc: OnDataRecv
804 * @tc.type: FUNC
805 */
806 HWTEST_F(DSchedContinueTest, OnDataRecvTest_032_1, TestSize.Level1)
807 {
808 DTEST_LOG << "DSchedContinueTest OnDataRecvTest_032_1 begin" << std::endl;
809 ASSERT_NE(conti_, nullptr);
810 ASSERT_NE(conti_->eventHandler_, nullptr);
811 int32_t command = 0;
812 std::shared_ptr<DSchedDataBuffer> dataBuffer = nullptr;
813 conti_->OnDataRecv(command, dataBuffer);
814 EXPECT_EQ(nullptr, dataBuffer);
815 command = DSCHED_CONTINUE_CMD_START;
816 dataBuffer = std::make_shared<DSchedDataBuffer>(DSCHED_BUFFER_SIZE);
817 conti_->OnDataRecv(command, dataBuffer);
818 EXPECT_NE(nullptr, dataBuffer);
819 command = DSCHED_CONTINUE_CMD_DATA;
820 conti_->OnDataRecv(command, dataBuffer);
821 EXPECT_NE(nullptr, dataBuffer);
822 command = DSCHED_CONTINUE_CMD_REPLY;
823 conti_->OnDataRecv(command, dataBuffer);
824 EXPECT_NE(nullptr, dataBuffer);
825 command = DSCHED_CONTINUE_CMD_END;
826 conti_->OnDataRecv(command, dataBuffer);
827 EXPECT_NE(nullptr, dataBuffer);
828 command = DSCHED_CONTINUE_CMD_MIN;
829 conti_->OnDataRecv(command, dataBuffer);
830 EXPECT_NE(nullptr, dataBuffer);
831 DTEST_LOG << "DSchedContinueTest OnDataRecvTest_032_1 end" << std::endl;
832 }
833
834 /**
835 * @tc.name: UpdateStateTest_033_1
836 * @tc.desc: UpdateState
837 * @tc.type: FUNC
838 */
839 HWTEST_F(DSchedContinueTest, UpdateStateTest_033_1, TestSize.Level1)
840 {
841 DTEST_LOG << "DSchedContinueTest UpdateStateTest_033_1 begin" << std::endl;
842 ASSERT_NE(conti_, nullptr);
843 ASSERT_NE(conti_->eventHandler_, nullptr);
844 DSchedContinueStateType stateType = DSCHED_CONTINUE_SINK_START_STATE;
845 conti_->UpdateState(stateType);
846 EXPECT_NE(nullptr, conti_->stateMachine_);
847 DTEST_LOG << "DSchedContinueTest UpdateStateTest_033_1 end" << std::endl;
848 }
849
850 /**
851 * @tc.name: CheckStartPermission_034_1
852 * @tc.desc: CheckStartPermission
853 * @tc.type: FUNC
854 */
855 HWTEST_F(DSchedContinueTest, CheckStartPermission_034_1, TestSize.Level1)
856 {
857 DTEST_LOG << "DSchedContinueTest CheckStartPermission_034_1 begin" << std::endl;
858 ASSERT_NE(conti_, nullptr);
859 ASSERT_NE(conti_->eventHandler_, nullptr);
860
861 auto cmd = std::make_shared<DSchedContinueDataCmd>();
862 ASSERT_NE(nullptr, cmd);
863 cmd->srcBundleName_ = BUNDLEMAME_1;
864 cmd->dstBundleName_ = BUNDLEMAME_1;
865
866 int32_t ret = conti_->CheckStartPermission(cmd);
867 EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
868 cmd->srcBundleName_.clear();
869 ret = conti_->CheckStartPermission(cmd);
870 EXPECT_EQ(ret, INVALID_PARAMETERS_ERR);
871 DTEST_LOG << "DSchedContinueTest CheckStartPermission_034_1 end" << std::endl;
872 }
873
874 /**
875 * @tc.name: ConvertToDmsSdkErr_035_1
876 * @tc.desc: ConvertToDmsSdkErr
877 * @tc.type: FUNC
878 */
879 HWTEST_F(DSchedContinueTest, ConvertToDmsSdkErr_035_1, TestSize.Level1)
880 {
881 DTEST_LOG << "DSchedContinueTest ConvertToDmsSdkErr_035_1 begin" << std::endl;
882 ASSERT_NE(conti_, nullptr);
883 ASSERT_NE(conti_->eventHandler_, nullptr);
884
885 auto cmd = std::make_shared<DSchedContinueDataCmd>();
886 ASSERT_NE(nullptr, cmd);
887 cmd->srcBundleName_ = BUNDLEMAME_1;
888 cmd->dstBundleName_ = BUNDLEMAME_1;
889
890 int32_t ret = conti_->ConvertToDmsSdkErr(0);
891 EXPECT_EQ(ret, ERR_OK);
892 ret = conti_->ConvertToDmsSdkErr(SoftBusErrNo::SOFTBUS_CONN_PASSIVE_TYPE_AP_STA_CHIP_CONFLICT);
893 EXPECT_EQ(ret, DmsInterfaceSdkErr::ERR_BIND_REMOTE_HOTSPOT_ENABLE_STATE);
894 ret = conti_->ConvertToDmsSdkErr(-1);
895 EXPECT_EQ(ret, DmsInterfaceSdkErr::ERR_DMS_WORK_ABNORMALLY);
896 DTEST_LOG << "DSchedContinueTest ConvertToDmsSdkErr_035_1 end" << std::endl;
897 }
898
GetPersistentId(int32_t & persistentId,std::string & ContinueSessionId)899 int32_t ContinueSceneSessionHandler::GetPersistentId(int32_t& persistentId, std::string &ContinueSessionId)
900 {
901 persistentId = 1;
902 return ERR_OK;
903 }
904
905 /**
906 * @tc.name: ExecuteQuickStartSuccess_036
907 * @tc.desc: ExecuteQuickStartSuccess
908 * @tc.type: FUNC
909 */
910 HWTEST_F(DSchedContinueTest, ExecuteQuickStartSuccess_036, TestSize.Level1)
911 {
912 DTEST_LOG << "DSchedContinueTest ExecuteQuickStartSuccess_036 begin" << std::endl;
913 ASSERT_NE(conti_, nullptr);
914 ASSERT_NE(conti_->eventHandler_, nullptr);
915
916 int32_t ret = conti_->ExecuteQuickStartSuccess();
917 EXPECT_EQ(ret, ERR_OK);
918 DTEST_LOG << "DSchedContinueTest ExecuteQuickStartSuccess_036 end ret:" << ret << std::endl;
919 }
920
921 /**
922 * @tc.name: ExecuteQuickStartFailed_037
923 * @tc.desc: ExecuteQuickStartFailed
924 * @tc.type: FUNC
925 */
926 HWTEST_F(DSchedContinueTest, ExecuteQuickStartFailed_037, TestSize.Level1)
927 {
928 DTEST_LOG << "DSchedContinueTest ExecuteQuickStartFailed_037 begin" << std::endl;
929 ASSERT_NE(conti_, nullptr);
930 ASSERT_NE(conti_->eventHandler_, nullptr);
931
932 int32_t ret = conti_->ExecuteQuickStartFailed(1);
933 EXPECT_EQ(ret, ERR_OK);
934 DTEST_LOG << "DSchedContinueTest ExecuteQuickStartFailed_037 end ret:" << ret << std::endl;
935 }
936
937 /**
938 * @tc.name: ExecuteQuickStartFailed_037
939 * @tc.desc: ExecuteQuickStartFailed
940 * @tc.type: FUNC
941 */
942 HWTEST_F(DSchedContinueTest, OnRemoteDied_038, TestSize.Level1)
943 {
944 DTEST_LOG << "DSchedContinueTest OnRemoteDied_038 begin" << std::endl;
945 sptr<StateCallbackIpcDiedListener> diedListener = new StateCallbackIpcDiedListener();
946 EXPECT_NO_FATAL_FAILURE(diedListener->OnRemoteDied(nullptr));
947 DTEST_LOG << "DSchedContinueTest OnRemoteDied_038 end ret:" << std::endl;
948 usleep(WAITTIME);
949 }
950 }
951 }
952