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 #define private public 18 #include "start_options_impl.h" 19 #undef private 20 #include "hilog_tag_wrapper.h" 21 #ifdef START_WINDOW_OPTIONS_WITH_PIXELMAP 22 #include "pixelmap_native_impl.h" 23 #endif 24 #include "securec.h" 25 #include "start_window_option.h" 26 27 using namespace testing; 28 29 constexpr int MAX_SUPPOPRT_WINDOW_MODES_SIZE = 10; 30 31 // Test suite 32 class StartOptionsImplTest : public ::testing::Test { 33 protected: SetUp()34 void SetUp() override 35 { 36 // Create a StartOptionsImpl object before each test case 37 startOptions = new AbilityRuntime_StartOptions(); 38 } 39 TearDown()40 void TearDown() override 41 { 42 // Delete the StartOptionsImpl object after each test case 43 delete startOptions; 44 startOptions = nullptr; 45 } 46 47 // Declare a StartOptionsImpl pointer 48 AbilityRuntime_StartOptions* startOptions = nullptr; 49 }; 50 51 // Test cases 52 // Test SetStartOptionsWindowMode function - Normal case 53 /** 54 * @tc.name: SetStartOptionsWindowMode_001 55 * @tc.desc: test class StartOptions number function 56 * @tc.type: FUNC 57 */ 58 HWTEST_F(StartOptionsImplTest, SetStartOptionsWindowMode_001, testing::ext::TestSize.Level1) 59 { 60 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWindowMode_001 begin"); 61 // Arrange 62 AbilityRuntime_WindowMode windowMode = ABILITY_RUNTIME_WINDOW_MODE_FULL_SCREEN; 63 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 64 65 // Act 66 AbilityRuntime_ErrorCode resultErrorCode = startOptions->SetStartOptionsWindowMode(windowMode); 67 TAG_LOGI(AAFwkTag::TEST, 68 "SetStartOptionsWindowMode_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 69 resultErrorCode, expectedErrorCode); 70 71 // Assert 72 EXPECT_EQ(expectedErrorCode, resultErrorCode); 73 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWindowMode_001 end"); 74 } 75 76 // Test SetStartOptionsWindowMode function - Boundary case 77 /** 78 * @tc.name: SetStartOptionsWindowMode_002 79 * @tc.desc: test class StartOptions number function 80 * @tc.type: FUNC 81 */ 82 HWTEST_F(StartOptionsImplTest, SetStartOptionsWindowMode_002, testing::ext::TestSize.Level1) 83 { 84 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWindowMode_002 begin"); 85 // Arrange 86 AbilityRuntime_WindowMode windowMode = ABILITY_RUNTIME_WINDOW_MODE_UNDEFINED; 87 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 88 89 // Act 90 AbilityRuntime_ErrorCode resultErrorCode = startOptions->SetStartOptionsWindowMode(windowMode); 91 TAG_LOGI(AAFwkTag::TEST, 92 "SetStartOptionsWindowMode_002 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 93 resultErrorCode, expectedErrorCode); 94 95 // Assert 96 EXPECT_EQ(expectedErrorCode, resultErrorCode); 97 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWindowMode_002 end"); 98 } 99 100 // Test SetStartOptionsWindowMode function - Exception case 101 /** 102 * @tc.name: SetStartOptionsWindowMode_003 103 * @tc.desc: test class StartOptions number function 104 * @tc.type: FUNC 105 */ 106 HWTEST_F(StartOptionsImplTest, SetStartOptionsWindowMode_003, testing::ext::TestSize.Level1) 107 { 108 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWindowMode_003 begin"); 109 // Arrange 110 // Assuming 100 is outside the enum definition range 111 AbilityRuntime_WindowMode windowMode = static_cast<AbilityRuntime_WindowMode>(100); 112 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID; 113 114 // Act 115 AbilityRuntime_ErrorCode resultErrorCode = startOptions->SetStartOptionsWindowMode(windowMode); 116 TAG_LOGI(AAFwkTag::TEST, 117 "SetStartOptionsWindowMode_003 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 118 resultErrorCode, expectedErrorCode); 119 120 // Assert 121 EXPECT_EQ(expectedErrorCode, resultErrorCode); 122 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWindowMode_003 end"); 123 } 124 125 // Test cases 126 // Test GetStartOptionsWindowMode function - Normal case 127 /** 128 * @tc.name: GetStartOptionsWindowMode_001 129 * @tc.desc: test class StartOptions number function 130 * @tc.type: FUNC 131 */ 132 HWTEST_F(StartOptionsImplTest, GetStartOptionsWindowMode_001, testing::ext::TestSize.Level1) 133 { 134 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowMode_001 begin"); 135 // Arrange 136 AbilityRuntime_WindowMode expectedWindowMode = ABILITY_RUNTIME_WINDOW_MODE_FULL_SCREEN; 137 startOptions->SetStartOptionsWindowMode(expectedWindowMode); 138 AbilityRuntime_WindowMode windowMode; 139 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 140 141 // Act 142 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsWindowMode(windowMode); 143 TAG_LOGI(AAFwkTag::TEST, 144 "GetStartOptionsWindowMode_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 145 resultErrorCode, expectedErrorCode); 146 147 // Assert 148 EXPECT_EQ(expectedErrorCode, resultErrorCode); 149 EXPECT_EQ(expectedWindowMode, windowMode); 150 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowMode_001 end"); 151 } 152 153 // Test cases 154 // Test SetStartOptionsDisplayId function - Normal case 155 /** 156 * @tc.name: SetStartOptionsDisplayId_001 157 * @tc.desc: test class StartOptions number function 158 * @tc.type: FUNC 159 */ 160 HWTEST_F(StartOptionsImplTest, SetStartOptionsDisplayId_001, testing::ext::TestSize.Level1) 161 { 162 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsDisplayId_001 begin"); 163 // Arrange 164 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 165 166 // Act 167 int32_t displayId = 10; 168 AbilityRuntime_ErrorCode resultErrorCode = startOptions->SetStartOptionsDisplayId(displayId); 169 TAG_LOGI(AAFwkTag::TEST, 170 "SetStartOptionsDisplayId_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 171 resultErrorCode, expectedErrorCode); 172 173 // Assert 174 EXPECT_EQ(expectedErrorCode, resultErrorCode); 175 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsDisplayId_001 end"); 176 } 177 178 // Test cases 179 // Test GetStartOptionsDisplayId function - Normal case 180 /** 181 * @tc.name: GetStartOptionsDisplayId_001 182 * @tc.desc: test class StartOptions number function 183 * @tc.type: FUNC 184 */ 185 HWTEST_F(StartOptionsImplTest, GetStartOptionsDisplayId_001, testing::ext::TestSize.Level1) 186 { 187 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsDisplayId_001 begin"); 188 // Arrange 189 int32_t expectedDisplayId = 10; 190 startOptions->SetStartOptionsDisplayId(expectedDisplayId); 191 int32_t displayId; 192 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 193 194 // Act 195 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsDisplayId(displayId); 196 TAG_LOGI(AAFwkTag::TEST, 197 "GetStartOptionsDisplayId_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 198 resultErrorCode, expectedErrorCode); 199 200 // Assert 201 EXPECT_EQ(expectedErrorCode, resultErrorCode); 202 EXPECT_EQ(expectedDisplayId, displayId); 203 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsDisplayId_001 end"); 204 } 205 206 // Test cases 207 // Test SetStartOptionsWithAnimation function - Normal case 208 /** 209 * @tc.name: SetStartOptionsWithAnimation_001 210 * @tc.desc: test class StartOptions number function 211 * @tc.type: FUNC 212 */ 213 HWTEST_F(StartOptionsImplTest, SetStartOptionsWithAnimation_001, testing::ext::TestSize.Level1) 214 { 215 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWithAnimation_001 begin"); 216 // Arrange 217 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 218 219 // Act 220 AbilityRuntime_ErrorCode resultErrorCode = startOptions->SetStartOptionsWithAnimation(true); 221 TAG_LOGI(AAFwkTag::TEST, 222 "SetStartOptionsWithAnimation_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 223 resultErrorCode, expectedErrorCode); 224 225 // Assert 226 EXPECT_EQ(expectedErrorCode, resultErrorCode); 227 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWithAnimation_001 end"); 228 } 229 230 // Test cases 231 // Test GetStartOptionsWithAnimation function - Normal case 232 /** 233 * @tc.name: GetStartOptionsWithAnimation_001 234 * @tc.desc: test class StartOptions number function 235 * @tc.type: FUNC 236 */ 237 HWTEST_F(StartOptionsImplTest, GetStartOptionsWithAnimation_001, testing::ext::TestSize.Level1) 238 { 239 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWithAnimation_001 begin"); 240 // Arrange 241 bool expectedWithAnimation = true; 242 startOptions->SetStartOptionsWithAnimation(expectedWithAnimation); 243 bool withAnimation; 244 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 245 246 // Act 247 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsWithAnimation(withAnimation); 248 TAG_LOGI(AAFwkTag::TEST, 249 "GetStartOptionsWithAnimation_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 250 resultErrorCode, expectedErrorCode); 251 252 // Assert 253 EXPECT_EQ(expectedErrorCode, resultErrorCode); 254 EXPECT_EQ(expectedWithAnimation, withAnimation); 255 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWithAnimation_001 end"); 256 } 257 258 // Test cases 259 // Test SetStartOptionsWindowLeft function - Normal case 260 /** 261 * @tc.name: SetStartOptionsWindowLeft_001 262 * @tc.desc: test class StartOptions number function 263 * @tc.type: FUNC 264 */ 265 HWTEST_F(StartOptionsImplTest, SetStartOptionsWindowLeft_001, testing::ext::TestSize.Level1) 266 { 267 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWindowLeft_001 begin"); 268 // Arrange 269 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 270 271 // Act 272 int32_t windowLeft = 100; 273 AbilityRuntime_ErrorCode resultErrorCode = startOptions->SetStartOptionsWindowLeft(windowLeft); 274 TAG_LOGI(AAFwkTag::TEST, 275 "SetStartOptionsWindowLeft_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 276 resultErrorCode, expectedErrorCode); 277 278 // Assert 279 EXPECT_EQ(expectedErrorCode, resultErrorCode); 280 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWindowLeft_001 end"); 281 } 282 283 // Test cases 284 // Test GetStartOptionsWindowLeft function - Normal case 285 /** 286 * @tc.name: GetStartOptionsWindowLeft_001 287 * @tc.desc: test class StartOptions number function 288 * @tc.type: FUNC 289 */ 290 HWTEST_F(StartOptionsImplTest, GetStartOptionsWindowLeft_001, testing::ext::TestSize.Level1) 291 { 292 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowLeft_001 begin"); 293 // Arrange 294 int32_t expectedWindowLeft = 500; 295 startOptions->SetStartOptionsWindowLeft(expectedWindowLeft); 296 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 297 298 // Act 299 int32_t windowLeft = 500; 300 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsWindowLeft(windowLeft); 301 TAG_LOGI(AAFwkTag::TEST, 302 "GetStartOptionsWindowLeft_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 303 resultErrorCode, expectedErrorCode); 304 305 // Assert 306 EXPECT_EQ(expectedErrorCode, resultErrorCode); 307 EXPECT_EQ(expectedWindowLeft, windowLeft); 308 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowLeft_001 end"); 309 } 310 311 // Test cases 312 // Test GetStartOptionsWindowLeft function 313 /** 314 * @tc.name: GetStartOptionsWindowLeft_002 315 * @tc.desc: test class StartOptions number function 316 * @tc.type: FUNC 317 */ 318 HWTEST_F(StartOptionsImplTest, GetStartOptionsWindowLeft_002, testing::ext::TestSize.Level1) 319 { 320 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowLeft_002 begin"); 321 // Arrange 322 int32_t expectedWindowLeft = -100; 323 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 324 325 // Act 326 int32_t windowLeft = -100; 327 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsWindowLeft(windowLeft); 328 TAG_LOGI(AAFwkTag::TEST, 329 "GetStartOptionsWindowLeft_002 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 330 resultErrorCode, expectedErrorCode); 331 332 // Assert 333 EXPECT_EQ(expectedErrorCode, resultErrorCode); 334 EXPECT_EQ(expectedWindowLeft, windowLeft); 335 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowLeft_002 end"); 336 } 337 338 // Test cases 339 // Test SetStartOptionsWindowTop function - Normal case 340 /** 341 * @tc.name: SetStartOptionsWindowTop_001 342 * @tc.desc: test class StartOptions number function 343 * @tc.type: FUNC 344 */ 345 HWTEST_F(StartOptionsImplTest, SetStartOptionsWindowTop_001, testing::ext::TestSize.Level1) 346 { 347 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWindowTop_001 begin"); 348 // Arrange 349 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 350 351 // Act 352 int32_t windowTop = 100; 353 AbilityRuntime_ErrorCode resultErrorCode = startOptions->SetStartOptionsWindowTop(windowTop); 354 TAG_LOGI(AAFwkTag::TEST, 355 "SetStartOptionsWindowTop_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 356 resultErrorCode, expectedErrorCode); 357 358 // Assert 359 EXPECT_EQ(expectedErrorCode, resultErrorCode); 360 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWindowTop_001 end"); 361 } 362 363 // Test cases 364 // Test GetStartOptionsWindowTop function - Normal case 365 /** 366 * @tc.name: GetStartOptionsWindowTop_001 367 * @tc.desc: test class StartOptions number function 368 * @tc.type: FUNC 369 */ 370 HWTEST_F(StartOptionsImplTest, GetStartOptionsWindowTop_001, testing::ext::TestSize.Level1) 371 { 372 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowTop_001 begin"); 373 // Arrange 374 int32_t expectedWindowTop = 500; 375 startOptions->SetStartOptionsWindowTop(expectedWindowTop); 376 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 377 378 // Act 379 int32_t windowTop = 500; 380 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsWindowTop(windowTop); 381 TAG_LOGI(AAFwkTag::TEST, 382 "GetStartOptionsWindowTop_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 383 resultErrorCode, expectedErrorCode); 384 385 // Assert 386 EXPECT_EQ(expectedErrorCode, resultErrorCode); 387 EXPECT_EQ(expectedWindowTop, windowTop); 388 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowTop_001 end"); 389 } 390 391 // Test cases 392 // Test GetStartOptionsWindowTop function 393 /** 394 * @tc.name: GetStartOptionsWindowTop_002 395 * @tc.desc: test class StartOptions number function 396 * @tc.type: FUNC 397 */ 398 HWTEST_F(StartOptionsImplTest, GetStartOptionsWindowTop_002, testing::ext::TestSize.Level1) 399 { 400 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowTop_002 begin"); 401 // Arrange 402 int32_t expectedWindowTop = 500; 403 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 404 405 // Act 406 int32_t windowTop = 500; 407 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsWindowTop(windowTop); 408 TAG_LOGI(AAFwkTag::TEST, 409 "GetStartOptionsWindowTop_002 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 410 resultErrorCode, expectedErrorCode); 411 412 // Assert 413 EXPECT_EQ(expectedErrorCode, resultErrorCode); 414 EXPECT_EQ(expectedWindowTop, windowTop); 415 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowTop_002 end"); 416 } 417 418 // Test cases 419 // Test SetStartOptionsWindowHeight function - Normal case 420 /** 421 * @tc.name: SetStartOptionsWindowHeight_001 422 * @tc.desc: test class StartOptions number function 423 * @tc.type: FUNC 424 */ 425 HWTEST_F(StartOptionsImplTest, SetStartOptionsWindowHeight_001, testing::ext::TestSize.Level1) 426 { 427 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWindowHeight_001 begin"); 428 // Arrange 429 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 430 431 // Act 432 int32_t windowHeight = 100; 433 AbilityRuntime_ErrorCode resultErrorCode = startOptions->SetStartOptionsWindowHeight(windowHeight); 434 TAG_LOGI(AAFwkTag::TEST, 435 "SetStartOptionsWindowHeight_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 436 resultErrorCode, expectedErrorCode); 437 438 // Assert 439 EXPECT_EQ(expectedErrorCode, resultErrorCode); 440 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWindowHeight_001 end"); 441 } 442 443 // Test cases 444 // Test GetStartOptionsWindowHeight function - Normal case 445 /** 446 * @tc.name: GetStartOptionsWindowHeight_001 447 * @tc.desc: test class StartOptions number function 448 * @tc.type: FUNC 449 */ 450 HWTEST_F(StartOptionsImplTest, GetStartOptionsWindowHeight_001, testing::ext::TestSize.Level1) 451 { 452 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowHeight_001 begin"); 453 // Arrange 454 int32_t expectedWindowHeight = 500; 455 startOptions->SetStartOptionsWindowHeight(expectedWindowHeight); 456 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 457 458 // Act 459 int32_t windowHeight = 500; 460 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsWindowHeight(windowHeight); 461 TAG_LOGI(AAFwkTag::TEST, 462 "GetStartOptionsWindowHeight_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 463 resultErrorCode, expectedErrorCode); 464 465 // Assert 466 EXPECT_EQ(expectedErrorCode, resultErrorCode); 467 EXPECT_EQ(expectedWindowHeight, windowHeight); 468 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowHeight_001 end"); 469 } 470 471 // Test cases 472 // Test GetStartOptionsWindowHeight function 473 /** 474 * @tc.name: GetStartOptionsWindowHeight_002 475 * @tc.desc: test class StartOptions number function 476 * @tc.type: FUNC 477 */ 478 HWTEST_F(StartOptionsImplTest, GetStartOptionsWindowHeight_002, testing::ext::TestSize.Level1) 479 { 480 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowHeight_002 begin"); 481 // Arrange 482 int32_t expectedWindowHeight = 500; 483 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 484 485 // Act 486 int32_t windowHeight = 500; 487 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsWindowHeight(windowHeight); 488 TAG_LOGI(AAFwkTag::TEST, 489 "GetStartOptionsWindowHeight_002 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 490 resultErrorCode, expectedErrorCode); 491 492 // Assert 493 EXPECT_EQ(expectedErrorCode, resultErrorCode); 494 EXPECT_EQ(expectedWindowHeight, windowHeight); 495 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowHeight_002 end"); 496 } 497 498 // Test cases 499 // Test SetStartOptionsWindowWidth function - Normal case 500 /** 501 * @tc.name: SetStartOptionsWindowWidth_001 502 * @tc.desc: test class StartOptions number function 503 * @tc.type: FUNC 504 */ 505 HWTEST_F(StartOptionsImplTest, SetStartOptionsWindowWidth_001, testing::ext::TestSize.Level1) 506 { 507 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWindowWidth_001 begin"); 508 // Arrange 509 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 510 511 // Act 512 int32_t windowWidth = 100; 513 AbilityRuntime_ErrorCode resultErrorCode = startOptions->SetStartOptionsWindowWidth(windowWidth); 514 TAG_LOGI(AAFwkTag::TEST, 515 "SetStartOptionsWindowWidth_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 516 resultErrorCode, expectedErrorCode); 517 518 // Assert 519 EXPECT_EQ(expectedErrorCode, resultErrorCode); 520 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsWindowWidth_001 end"); 521 } 522 523 // Test cases 524 // Test GetStartOptionsWindowWidth function - Normal case 525 /** 526 * @tc.name: GetStartOptionsWindowWidth_001 527 * @tc.desc: test class StartOptions number function 528 * @tc.type: FUNC 529 */ 530 HWTEST_F(StartOptionsImplTest, GetStartOptionsWindowWidth_001, testing::ext::TestSize.Level1) 531 { 532 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowWidth_001 begin"); 533 // Arrange 534 int32_t expectedWindowWidth = 500; 535 startOptions->SetStartOptionsWindowWidth(expectedWindowWidth); 536 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 537 538 // Act 539 int32_t windowWidth = 500; 540 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsWindowWidth(windowWidth); 541 TAG_LOGI(AAFwkTag::TEST, 542 "GetStartOptionsWindowWidth_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 543 resultErrorCode, expectedErrorCode); 544 545 // Assert 546 EXPECT_EQ(expectedErrorCode, resultErrorCode); 547 EXPECT_EQ(expectedWindowWidth, windowWidth); 548 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowWidth_001 end"); 549 } 550 551 // Test cases 552 // Test GetStartOptionsWindowWidth function 553 /** 554 * @tc.name: GetStartOptionsWindowWidth_002 555 * @tc.desc: test class StartOptions number function 556 * @tc.type: FUNC 557 */ 558 HWTEST_F(StartOptionsImplTest, GetStartOptionsWindowWidth_002, testing::ext::TestSize.Level1) 559 { 560 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowWidth_002 begin"); 561 // Arrange 562 int32_t expectedWindowWidth = 500; 563 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 564 565 // Act 566 int32_t windowWidth = 500; 567 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsWindowWidth(windowWidth); 568 TAG_LOGI(AAFwkTag::TEST, 569 "GetStartOptionsWindowWidth_002 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 570 resultErrorCode, expectedErrorCode); 571 572 // Assert 573 EXPECT_EQ(expectedErrorCode, resultErrorCode); 574 EXPECT_EQ(expectedWindowWidth, windowWidth); 575 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsWindowWidth_002 end"); 576 } 577 578 // Test cases 579 // Test SetStartOptionsStartVisibility function - Normal case 580 /** 581 * @tc.name: SetStartOptionsStartVisibility_001 582 * @tc.desc: test class StartOptions number function 583 * @tc.type: FUNC 584 */ 585 HWTEST_F(StartOptionsImplTest, SetStartOptionsStartVisibility_001, testing::ext::TestSize.Level1) 586 { 587 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsStartVisibility_001 begin"); 588 // Arrange 589 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 590 591 // Act 592 AbilityRuntime_StartVisibility startVisibility = AbilityRuntime_StartVisibility::ABILITY_RUNTIME_SHOW_UPON_START; 593 AbilityRuntime_ErrorCode resultErrorCode = startOptions->SetStartOptionsStartVisibility(startVisibility); 594 TAG_LOGI(AAFwkTag::TEST, 595 "SetStartOptionsStartVisibility_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 596 resultErrorCode, expectedErrorCode); 597 598 // Assert 599 EXPECT_EQ(expectedErrorCode, resultErrorCode); 600 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsStartVisibility_001 end"); 601 } 602 603 // Test cases 604 // Test GetStartOptionsStartVisibility function - Normal case 605 /** 606 * @tc.name: GetStartOptionsStartVisibility_001 607 * @tc.desc: test class StartOptions number function 608 * @tc.type: FUNC 609 */ 610 HWTEST_F(StartOptionsImplTest, GetStartOptionsStartVisibility_001, testing::ext::TestSize.Level1) 611 { 612 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsStartVisibility_001 begin"); 613 // Arrange 614 AbilityRuntime_StartVisibility expectedStartVisibility = 615 AbilityRuntime_StartVisibility::ABILITY_RUNTIME_SHOW_UPON_START; 616 startOptions->SetStartOptionsStartVisibility(expectedStartVisibility); 617 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 618 619 // Act 620 AbilityRuntime_StartVisibility startVisibility = AbilityRuntime_StartVisibility::ABILITY_RUNTIME_HIDE_UPON_START; 621 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsStartVisibility(startVisibility); 622 TAG_LOGI(AAFwkTag::TEST, 623 "GetStartOptionsStartVisibility_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 624 resultErrorCode, expectedErrorCode); 625 626 // Assert 627 EXPECT_EQ(expectedErrorCode, resultErrorCode); 628 EXPECT_EQ(expectedStartVisibility, startVisibility); 629 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsStartVisibility_001 end"); 630 } 631 632 // Test cases 633 // Test GetStartOptionsStartVisibility function - Get without set 634 /** 635 * @tc.name: GetStartOptionsStartVisibility_002 636 * @tc.desc: test class StartOptions number function 637 * @tc.type: FUNC 638 */ 639 HWTEST_F(StartOptionsImplTest, GetStartOptionsStartVisibility_002, testing::ext::TestSize.Level1) 640 { 641 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsStartVisibility_002 begin"); 642 // Arrange 643 startOptions = new AbilityRuntime_StartOptions(); 644 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID; 645 646 // Act 647 AbilityRuntime_StartVisibility startVisibility = AbilityRuntime_StartVisibility::ABILITY_RUNTIME_HIDE_UPON_START; 648 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsStartVisibility(startVisibility); 649 TAG_LOGI(AAFwkTag::TEST, 650 "GetStartOptionsStartVisibility_002 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 651 resultErrorCode, expectedErrorCode); 652 653 // Assert 654 EXPECT_EQ(expectedErrorCode, resultErrorCode); 655 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsStartVisibility_002 end"); 656 } 657 658 // Test cases 659 // Test SetStartOptionsStartWindowIcon function - Normal case 660 /** 661 * @tc.name: SetStartOptionsStartWindowIcon_001 662 * @tc.desc: test class StartOptions number function 663 * @tc.type: FUNC 664 */ 665 HWTEST_F(StartOptionsImplTest, SetStartOptionsStartWindowIcon_001, testing::ext::TestSize.Level1) 666 { 667 #ifdef START_WINDOW_OPTIONS_WITH_PIXELMAP 668 OH_PixelmapNative* startWindowIcon = nullptr; 669 EXPECT_EQ(startOptions->SetStartOptionsStartWindowIcon(startWindowIcon), 670 ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID); 671 #endif 672 } 673 674 // Test cases 675 // Test SetStartOptionsStartWindowIcon function - Normal case 676 /** 677 * @tc.name: SetStartOptionsStartWindowIcon_002 678 * @tc.desc: test class StartOptions number function 679 * @tc.type: FUNC 680 */ 681 HWTEST_F(StartOptionsImplTest, SetStartOptionsStartWindowIcon_002, testing::ext::TestSize.Level1) 682 { 683 #ifdef START_WINDOW_OPTIONS_WITH_PIXELMAP 684 OH_PixelmapNative *startWindowIcon = new OH_PixelmapNative(nullptr); 685 EXPECT_EQ(startOptions->SetStartOptionsStartWindowIcon(startWindowIcon), 686 ABILITY_RUNTIME_ERROR_CODE_NO_ERROR); 687 delete startWindowIcon; 688 #endif 689 } 690 691 // Test cases 692 // Test SetStartOptionsStartWindowIcon function - Normal case 693 /** 694 * @tc.name: SetStartOptionsStartWindowIcon_003 695 * @tc.desc: test class StartOptions number function 696 * @tc.type: FUNC 697 */ 698 HWTEST_F(StartOptionsImplTest, SetStartOptionsStartWindowIcon_003, testing::ext::TestSize.Level1) 699 { 700 #ifdef START_WINDOW_OPTIONS_WITH_PIXELMAP 701 OH_PixelmapNative *startWindowIcon = new OH_PixelmapNative(nullptr); 702 startOptions->options.startWindowOption = nullptr; 703 EXPECT_EQ(startOptions->SetStartOptionsStartWindowIcon(startWindowIcon), 704 ABILITY_RUNTIME_ERROR_CODE_NO_ERROR); 705 delete startWindowIcon; 706 #endif 707 } 708 709 // Test cases 710 // Test SetStartOptionsStartWindowIcon function - Normal case 711 /** 712 * @tc.name: SetStartOptionsStartWindowIcon_004 713 * @tc.desc: test class StartOptions number function 714 * @tc.type: FUNC 715 */ 716 HWTEST_F(StartOptionsImplTest, SetStartOptionsStartWindowIcon_004, testing::ext::TestSize.Level1) 717 { 718 #ifdef START_WINDOW_OPTIONS_WITH_PIXELMAP 719 OH_PixelmapNative *startWindowIcon = new OH_PixelmapNative(nullptr); 720 startOptions->options.startWindowOption = std::make_shared<OHOS::AAFwk::StartWindowOption>(); 721 EXPECT_EQ(startOptions->SetStartOptionsStartWindowIcon(startWindowIcon), 722 ABILITY_RUNTIME_ERROR_CODE_NO_ERROR); 723 delete startWindowIcon; 724 #endif 725 } 726 727 // Test cases 728 // Test GetStartOptionsStartWindowIcon function - Normal case 729 /** 730 * @tc.name: GetStartOptionsStartWindowIcon_001 731 * @tc.desc: test class StartOptions number function 732 * @tc.type: FUNC 733 */ 734 HWTEST_F(StartOptionsImplTest, GetStartOptionsStartWindowIcon_001, testing::ext::TestSize.Level1) 735 { 736 #ifdef START_WINDOW_OPTIONS_WITH_PIXELMAP 737 // Arrange 738 startOptions->options.startWindowOption = nullptr; 739 OH_PixelmapNative* startWindowIcon = nullptr; 740 741 // Act 742 AbilityRuntime_ErrorCode result = startOptions->GetStartOptionsStartWindowIcon(&startWindowIcon); 743 744 // Assert 745 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID, result); 746 #endif 747 } 748 749 // Test cases 750 // Test SetStartOptionsStartWindowIcon function - Normal case 751 /** 752 * @tc.name: GetStartOptionsStartWindowIcon_002 753 * @tc.desc: test class StartOptions number function 754 * @tc.type: FUNC 755 */ 756 HWTEST_F(StartOptionsImplTest, GetStartOptionsStartWindowIcon_002, testing::ext::TestSize.Level1) 757 { 758 #ifdef START_WINDOW_OPTIONS_WITH_PIXELMAP 759 // Arrange 760 startOptions->options.startWindowOption = std::make_shared<OHOS::AAFwk::StartWindowOption>(); 761 startOptions->options.startWindowOption->hasStartWindow = true; 762 startOptions->options.startWindowOption->startWindowIcon = nullptr; 763 OH_PixelmapNative* startWindowIcon = new OH_PixelmapNative(nullptr); 764 765 // Act 766 AbilityRuntime_ErrorCode result = startOptions->GetStartOptionsStartWindowIcon(&startWindowIcon); 767 768 // Assert 769 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID, result); 770 delete startWindowIcon; 771 #endif 772 } 773 774 // Test cases 775 // Test SetStartOptionsStartWindowIcon function - Normal case 776 /** 777 * @tc.name: GetStartOptionsStartWindowIcon_003 778 * @tc.desc: test class StartOptions number function 779 * @tc.type: FUNC 780 */ 781 HWTEST_F(StartOptionsImplTest, GetStartOptionsStartWindowIcon_003, testing::ext::TestSize.Level1) 782 { 783 #ifdef START_WINDOW_OPTIONS_WITH_PIXELMAP 784 // Arrange 785 startOptions->options.startWindowOption = std::make_shared<OHOS::AAFwk::StartWindowOption>(); 786 startOptions->options.startWindowOption->hasStartWindow = true; 787 startOptions->options.startWindowOption->startWindowIcon = nullptr; 788 OH_PixelmapNative* startWindowIcon = nullptr; 789 790 // Act 791 AbilityRuntime_ErrorCode result = startOptions->GetStartOptionsStartWindowIcon(&startWindowIcon); 792 793 // Assert 794 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_NO_ERROR, result); 795 EXPECT_NE(nullptr, startWindowIcon); 796 #endif 797 } 798 799 // Test cases 800 // Test SetStartOptionsStartWindowIcon function - Normal case 801 /** 802 * @tc.name: GetStartOptionsStartWindowIcon_004 803 * @tc.desc: test class StartOptions number function 804 * @tc.type: FUNC 805 */ 806 HWTEST_F(StartOptionsImplTest, GetStartOptionsStartWindowIcon_004, testing::ext::TestSize.Level1) 807 { 808 #ifdef START_WINDOW_OPTIONS_WITH_PIXELMAP 809 // Arrange 810 startOptions->options.startWindowOption = std::make_shared<OHOS::AAFwk::StartWindowOption>(); 811 startOptions->options.startWindowOption->hasStartWindow = false; 812 startOptions->options.startWindowOption->startWindowIcon = nullptr; 813 OH_PixelmapNative* startWindowIcon = nullptr; 814 815 // Act 816 AbilityRuntime_ErrorCode result = startOptions->GetStartOptionsStartWindowIcon(&startWindowIcon); 817 818 // Assert 819 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_NO_ERROR, result); 820 EXPECT_EQ(nullptr, startWindowIcon); 821 #endif 822 } 823 824 // Test cases 825 // Test SetStartOptionsStartWindowBackgroundColor function 826 /** 827 * @tc.name: SetStartOptionsStartWindowBackgroundColor_001 828 * @tc.desc: test class StartOptions number function 829 * @tc.type: FUNC 830 */ 831 HWTEST_F(StartOptionsImplTest, SetStartOptionsStartWindowBackgroundColor_001, testing::ext::TestSize.Level1) 832 { 833 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID, 834 startOptions->SetStartOptionsStartWindowBackgroundColor(nullptr)); 835 } 836 837 // Test cases 838 // Test SetStartOptionsStartWindowBackgroundColor function 839 /** 840 * @tc.name: SetStartOptionsStartWindowBackgroundColor_002 841 * @tc.desc: test class StartOptions number function 842 * @tc.type: FUNC 843 */ 844 HWTEST_F(StartOptionsImplTest, SetStartOptionsStartWindowBackgroundColor_002, testing::ext::TestSize.Level1) 845 { 846 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_NO_ERROR, 847 startOptions->SetStartOptionsStartWindowBackgroundColor("#FFFFFFFF")); 848 } 849 850 // Test cases 851 // Test SetStartOptionsStartWindowBackgroundColor function 852 /** 853 * @tc.name: SetStartOptionsStartWindowBackgroundColor_003 854 * @tc.desc: test class StartOptions number function 855 * @tc.type: FUNC 856 */ 857 HWTEST_F(StartOptionsImplTest, SetStartOptionsStartWindowBackgroundColor_003, testing::ext::TestSize.Level1) 858 { 859 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_NO_ERROR, 860 startOptions->SetStartOptionsStartWindowBackgroundColor("")); 861 } 862 863 // Test cases 864 // Test SetStartOptionsStartWindowBackgroundColor function 865 /** 866 * @tc.name: SetStartOptionsStartWindowBackgroundColor_004 867 * @tc.desc: test class StartOptions number function 868 * @tc.type: FUNC 869 */ 870 HWTEST_F(StartOptionsImplTest, SetStartOptionsStartWindowBackgroundColor_004, testing::ext::TestSize.Level1) 871 { 872 startOptions->options.startWindowOption = nullptr; 873 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_NO_ERROR, 874 startOptions->SetStartOptionsStartWindowBackgroundColor("FFFFFF")); 875 } 876 877 // Test cases 878 // Test GetStartOptionsStartWindowBackgroundColor function 879 /** 880 * @tc.name: GetStartOptionsStartWindowBackgroundColor_001 881 * @tc.desc: test class StartOptions number function 882 * @tc.type: FUNC 883 */ 884 HWTEST_F(StartOptionsImplTest, GetStartOptionsStartWindowBackgroundColor_001, testing::ext::TestSize.Level1) 885 { 886 // Arrange 887 startOptions->options.startWindowOption = nullptr; 888 char* startWindowBackgroundColor = nullptr; 889 size_t size = 0; 890 891 // Act 892 AbilityRuntime_ErrorCode result = startOptions->GetStartOptionsStartWindowBackgroundColor( 893 &startWindowBackgroundColor, size); 894 895 // Assert 896 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID, result); 897 } 898 899 // Test cases 900 // Test GetStartOptionsStartWindowBackgroundColor function 901 /** 902 * @tc.name: GetStartOptionsStartWindowBackgroundColor_002 903 * @tc.desc: test class StartOptions number function 904 * @tc.type: FUNC 905 */ 906 HWTEST_F(StartOptionsImplTest, GetStartOptionsStartWindowBackgroundColor_002, testing::ext::TestSize.Level1) 907 { 908 // Arrange 909 startOptions->options.startWindowOption = std::make_shared<OHOS::AAFwk::StartWindowOption>(); 910 startOptions->options.startWindowOption->hasStartWindow = true; 911 startOptions->options.startWindowOption->startWindowBackgroundColor = "red"; 912 char* startWindowBackgroundColor = const_cast<char*>("blue"); 913 size_t size = 0; 914 915 // Act 916 AbilityRuntime_ErrorCode result = startOptions->GetStartOptionsStartWindowBackgroundColor( 917 &startWindowBackgroundColor, size); 918 919 // Assert 920 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID, result); 921 } 922 923 // Test cases 924 // Test GetStartOptionsStartWindowBackgroundColor function 925 /** 926 * @tc.name: GetStartOptionsStartWindowBackgroundColor_003 927 * @tc.desc: test class StartOptions number function 928 * @tc.type: FUNC 929 */ 930 HWTEST_F(StartOptionsImplTest, GetStartOptionsStartWindowBackgroundColor_003, testing::ext::TestSize.Level1) 931 { 932 // Arrange 933 startOptions->options.startWindowOption = std::make_shared<OHOS::AAFwk::StartWindowOption>(); 934 startOptions->options.startWindowOption->hasStartWindow = true; 935 startOptions->options.startWindowOption->startWindowBackgroundColor = "red"; 936 char* startWindowBackgroundColor = nullptr; 937 size_t size = 0; 938 939 // Act 940 AbilityRuntime_ErrorCode result = startOptions->GetStartOptionsStartWindowBackgroundColor( 941 &startWindowBackgroundColor, size); 942 943 // Assert 944 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_NO_ERROR, result); 945 EXPECT_EQ(0, strcmp(startWindowBackgroundColor, "red")); 946 EXPECT_EQ(3, size); 947 } 948 949 // Test cases 950 // Test GetStartOptionsStartWindowBackgroundColor function 951 /** 952 * @tc.name: GetStartOptionsStartWindowBackgroundColor_004 953 * @tc.desc: test class StartOptions number function 954 * @tc.type: FUNC 955 */ 956 HWTEST_F(StartOptionsImplTest, GetStartOptionsStartWindowBackgroundColor_004, testing::ext::TestSize.Level1) 957 { 958 // Arrange 959 startOptions->options.startWindowOption = std::make_shared<OHOS::AAFwk::StartWindowOption>(); 960 startOptions->options.startWindowOption->hasStartWindow = false; 961 char* startWindowBackgroundColor = nullptr; 962 size_t size = 0; 963 964 // Act 965 AbilityRuntime_ErrorCode result = startOptions->GetStartOptionsStartWindowBackgroundColor( 966 &startWindowBackgroundColor, size); 967 968 // Assert 969 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_NO_ERROR, result); 970 EXPECT_EQ(startWindowBackgroundColor, nullptr); 971 EXPECT_EQ(size, 0); 972 } 973 974 // Test cases 975 // Test SetStartOptionsSupportedWindowModes function 976 /** 977 * @tc.name: SetStartOptionsSupportedWindowModes_001 978 * @tc.desc: test class StartOptions number function 979 * @tc.type: FUNC 980 */ 981 HWTEST_F(StartOptionsImplTest, SetStartOptionsSupportedWindowModes_001, testing::ext::TestSize.Level1) 982 { 983 AbilityRuntime_SupportedWindowMode* supportedWindowModes = nullptr; 984 size_t size = 1; 985 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID, 986 startOptions->SetStartOptionsSupportedWindowModes(supportedWindowModes, size)); 987 } 988 989 // Test cases 990 // Test SetStartOptionsSupportedWindowModes function 991 /** 992 * @tc.name: SetStartOptionsSupportedWindowModes_002 993 * @tc.desc: test class StartOptions number function 994 * @tc.type: FUNC 995 */ 996 HWTEST_F(StartOptionsImplTest, SetStartOptionsSupportedWindowModes_002, testing::ext::TestSize.Level1) 997 { 998 AbilityRuntime_SupportedWindowMode supportedWindowModes[1] = 999 { ABILITY_RUNTIME_SUPPORTED_WINDOW_MODE_FULL_SCREEN }; 1000 size_t size = 0; 1001 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID, 1002 startOptions->SetStartOptionsSupportedWindowModes(supportedWindowModes, size)); 1003 } 1004 1005 // Test cases 1006 // Test SetStartOptionsSupportedWindowModes function 1007 /** 1008 * @tc.name: SetStartOptionsSupportedWindowModes_003 1009 * @tc.desc: test class StartOptions number function 1010 * @tc.type: FUNC 1011 */ 1012 HWTEST_F(StartOptionsImplTest, SetStartOptionsSupportedWindowModes_003, testing::ext::TestSize.Level1) 1013 { 1014 AbilityRuntime_SupportedWindowMode supportedWindowModes[MAX_SUPPOPRT_WINDOW_MODES_SIZE + 1]; 1015 size_t size = MAX_SUPPOPRT_WINDOW_MODES_SIZE + 1; 1016 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID, 1017 startOptions->SetStartOptionsSupportedWindowModes(supportedWindowModes, size)); 1018 } 1019 1020 // Test cases 1021 // Test SetStartOptionsSupportedWindowModes function 1022 /** 1023 * @tc.name: SetStartOptionsSupportedWindowModes_004 1024 * @tc.desc: test class StartOptions number function 1025 * @tc.type: FUNC 1026 */ 1027 HWTEST_F(StartOptionsImplTest, SetStartOptionsSupportedWindowModes_004, testing::ext::TestSize.Level1) 1028 { 1029 AbilityRuntime_SupportedWindowMode supportedWindowModes[1] = 1030 { AbilityRuntime_SupportedWindowMode(999) }; // Invalid mode 1031 size_t size = 1; 1032 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID, 1033 startOptions->SetStartOptionsSupportedWindowModes(supportedWindowModes, size)); 1034 } 1035 1036 // Test cases 1037 // Test SetStartOptionsSupportedWindowModes function 1038 /** 1039 * @tc.name: SetStartOptionsSupportedWindowModes_005 1040 * @tc.desc: test class StartOptions number function 1041 * @tc.type: FUNC 1042 */ 1043 HWTEST_F(StartOptionsImplTest, SetStartOptionsSupportedWindowModes_005, testing::ext::TestSize.Level1) 1044 { 1045 AbilityRuntime_SupportedWindowMode supportedWindowModes[1] = 1046 { ABILITY_RUNTIME_SUPPORTED_WINDOW_MODE_FULL_SCREEN }; 1047 size_t size = 1; 1048 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_NO_ERROR, 1049 startOptions->SetStartOptionsSupportedWindowModes(supportedWindowModes, size)); 1050 } 1051 1052 // Test cases 1053 // Test GetStartOptionsSupportedWindowModes function 1054 /** 1055 * @tc.name: GetStartOptionsSupportedWindowModes_001 1056 * @tc.desc: test class StartOptions number function 1057 * @tc.type: FUNC 1058 */ 1059 HWTEST_F(StartOptionsImplTest, GetStartOptionsSupportedWindowModes_001, testing::ext::TestSize.Level1) 1060 { 1061 AbilityRuntime_SupportedWindowMode* supportedWindowModes = nullptr; 1062 size_t size = 0; 1063 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_NO_ERROR, 1064 startOptions->GetStartOptionsSupportedWindowModes(&supportedWindowModes, size)); 1065 } 1066 1067 // Test cases 1068 // Test GetStartOptionsSupportedWindowModes function 1069 /** 1070 * @tc.name: GetStartOptionsSupportedWindowModes_002 1071 * @tc.desc: test class StartOptions number function 1072 * @tc.type: FUNC 1073 */ 1074 HWTEST_F(StartOptionsImplTest, GetStartOptionsSupportedWindowModes_002, testing::ext::TestSize.Level1) 1075 { 1076 AbilityRuntime_SupportedWindowMode* supportedWindowModes = new AbilityRuntime_SupportedWindowMode; 1077 size_t size = 0; 1078 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_PARAM_INVALID, 1079 startOptions->GetStartOptionsSupportedWindowModes(&supportedWindowModes, size)); 1080 delete supportedWindowModes; 1081 } 1082 1083 // Test cases 1084 // Test GetStartOptionsSupportedWindowModes function 1085 /** 1086 * @tc.name: GetStartOptionsSupportedWindowModes_003 1087 * @tc.desc: test class StartOptions number function 1088 * @tc.type: FUNC 1089 */ 1090 HWTEST_F(StartOptionsImplTest, GetStartOptionsSupportedWindowModes_003, testing::ext::TestSize.Level1) 1091 { 1092 AbilityRuntime_SupportedWindowMode* supportedWindowModes = nullptr; 1093 size_t size = 0; 1094 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_NO_ERROR, 1095 startOptions->GetStartOptionsSupportedWindowModes(&supportedWindowModes, size)); 1096 EXPECT_EQ(0, size); 1097 EXPECT_EQ(nullptr, supportedWindowModes); 1098 } 1099 1100 // Test cases 1101 // Test GetStartOptionsSupportedWindowModes function 1102 /** 1103 * @tc.name: GetStartOptionsSupportedWindowModes_004 1104 * @tc.desc: test class StartOptions number function 1105 * @tc.type: FUNC 1106 */ 1107 HWTEST_F(StartOptionsImplTest, GetStartOptionsSupportedWindowModes_004, testing::ext::TestSize.Level1) 1108 { 1109 startOptions->options.supportWindowModes_.push_back( 1110 static_cast<OHOS::AppExecFwk::SupportWindowMode>(ABILITY_RUNTIME_SUPPORTED_WINDOW_MODE_FULL_SCREEN)); 1111 AbilityRuntime_SupportedWindowMode* supportedWindowModes = nullptr; 1112 size_t size = 0; 1113 EXPECT_EQ(ABILITY_RUNTIME_ERROR_CODE_NO_ERROR, 1114 startOptions->GetStartOptionsSupportedWindowModes(&supportedWindowModes, size)); 1115 EXPECT_EQ(1, size); 1116 EXPECT_NE(nullptr, supportedWindowModes); 1117 EXPECT_EQ(ABILITY_RUNTIME_SUPPORTED_WINDOW_MODE_FULL_SCREEN, supportedWindowModes[0]); 1118 free(supportedWindowModes); 1119 } 1120 1121 // Test cases 1122 // Test SetStartOptionsMinWindowWidth function - Normal case 1123 /** 1124 * @tc.name: SetStartOptionsMinWindowWidth_001 1125 * @tc.desc: test class StartOptions number function 1126 * @tc.type: FUNC 1127 */ 1128 HWTEST_F(StartOptionsImplTest, SetStartOptionsMinWindowWidth_001, testing::ext::TestSize.Level1) 1129 { 1130 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsMinWindowWidth_001 begin"); 1131 // Arrange 1132 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 1133 1134 // Act 1135 int32_t minWindowWidth = 100; 1136 AbilityRuntime_ErrorCode resultErrorCode = startOptions->SetStartOptionsMinWindowWidth(minWindowWidth); 1137 TAG_LOGI(AAFwkTag::TEST, 1138 "SetStartOptionsMinWindowWidth_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 1139 resultErrorCode, expectedErrorCode); 1140 1141 // Assert 1142 EXPECT_EQ(expectedErrorCode, resultErrorCode); 1143 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsMinWindowWidth_001 end"); 1144 } 1145 1146 // Test cases 1147 // Test GetStartOptionsMinWindowWidth function - Normal case 1148 /** 1149 * @tc.name: GetStartOptionsMinWindowWidth_001 1150 * @tc.desc: test class StartOptions number function 1151 * @tc.type: FUNC 1152 */ 1153 HWTEST_F(StartOptionsImplTest, GetStartOptionsMinWindowWidth_001, testing::ext::TestSize.Level1) 1154 { 1155 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMinWindowWidth_001 begin"); 1156 // Arrange 1157 int32_t expectedMinWindowWidth = 500; 1158 startOptions->SetStartOptionsMinWindowWidth(expectedMinWindowWidth); 1159 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 1160 1161 // Act 1162 int32_t minWindowWidth = 500; 1163 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsMinWindowWidth(minWindowWidth); 1164 TAG_LOGI(AAFwkTag::TEST, 1165 "GetStartOptionsMinWindowWidth_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 1166 resultErrorCode, expectedErrorCode); 1167 1168 // Assert 1169 EXPECT_EQ(expectedErrorCode, resultErrorCode); 1170 EXPECT_EQ(expectedMinWindowWidth, minWindowWidth); 1171 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMinWindowWidth_001 end"); 1172 } 1173 1174 // Test cases 1175 // Test GetStartOptionsMinWindowWidth function 1176 /** 1177 * @tc.name: GetStartOptionsMinWindowWidth_002 1178 * @tc.desc: test class StartOptions number function 1179 * @tc.type: FUNC 1180 */ 1181 HWTEST_F(StartOptionsImplTest, GetStartOptionsMinWindowWidth_002, testing::ext::TestSize.Level1) 1182 { 1183 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMinWindowWidth_002 begin"); 1184 // Arrange 1185 int32_t expectedMinWindowWidth = 500; 1186 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 1187 1188 // Act 1189 int32_t minWindowWidth = 500; 1190 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsMinWindowWidth(minWindowWidth); 1191 TAG_LOGI(AAFwkTag::TEST, 1192 "GetStartOptionsMinWindowWidth_002 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 1193 resultErrorCode, expectedErrorCode); 1194 1195 // Assert 1196 EXPECT_EQ(expectedErrorCode, resultErrorCode); 1197 EXPECT_EQ(expectedMinWindowWidth, minWindowWidth); 1198 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMinWindowWidth_002 end"); 1199 } 1200 1201 // Test cases 1202 // Test SetStartOptionsMaxWindowWidth function - Normal case 1203 /** 1204 * @tc.name: SetStartOptionsMaxWindowWidth_001 1205 * @tc.desc: test class StartOptions number function 1206 * @tc.type: FUNC 1207 */ 1208 HWTEST_F(StartOptionsImplTest, SetStartOptionsMaxWindowWidth_001, testing::ext::TestSize.Level1) 1209 { 1210 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsMaxWindowWidth_001 begin"); 1211 // Arrange 1212 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 1213 1214 // Act 1215 int32_t maxMaxWindowWidth = 100; 1216 AbilityRuntime_ErrorCode resultErrorCode = startOptions->SetStartOptionsMaxWindowWidth(maxMaxWindowWidth); 1217 TAG_LOGI(AAFwkTag::TEST, 1218 "SetStartOptionsMaxWindowWidth_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 1219 resultErrorCode, expectedErrorCode); 1220 1221 // Assert 1222 EXPECT_EQ(expectedErrorCode, resultErrorCode); 1223 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsMaxWindowWidth_001 end"); 1224 } 1225 1226 // Test cases 1227 // Test GetStartOptionsMaxWindowWidth function - Normal case 1228 /** 1229 * @tc.name: GetStartOptionsMaxWindowWidth_001 1230 * @tc.desc: test class StartOptions number function 1231 * @tc.type: FUNC 1232 */ 1233 HWTEST_F(StartOptionsImplTest, GetStartOptionsMaxWindowWidth_001, testing::ext::TestSize.Level1) 1234 { 1235 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMaxWindowWidth_001 begin"); 1236 // Arrange 1237 int32_t expectedMaxWindowWidth = 500; 1238 startOptions->SetStartOptionsMaxWindowWidth(expectedMaxWindowWidth); 1239 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 1240 1241 // Act 1242 int32_t maxWindowWidth = 500; 1243 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsMaxWindowWidth(maxWindowWidth); 1244 TAG_LOGI(AAFwkTag::TEST, 1245 "GetStartOptionsMaxWindowWidth_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 1246 resultErrorCode, expectedErrorCode); 1247 1248 // Assert 1249 EXPECT_EQ(expectedErrorCode, resultErrorCode); 1250 EXPECT_EQ(expectedMaxWindowWidth, maxWindowWidth); 1251 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMaxWindowWidth_001 end"); 1252 } 1253 1254 // Test cases 1255 // Test GetStartOptionsMaxWindowWidth function 1256 /** 1257 * @tc.name: GetStartOptionsMaxWindowWidth_002 1258 * @tc.desc: test class StartOptions number function 1259 * @tc.type: FUNC 1260 */ 1261 HWTEST_F(StartOptionsImplTest, GetStartOptionsMaxWindowWidth_002, testing::ext::TestSize.Level1) 1262 { 1263 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMaxWindowWidth_002 begin"); 1264 // Arrange 1265 int32_t expectedMaxWindowWidth = 500; 1266 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 1267 1268 // Act 1269 int32_t maxWindowWidth = 500; 1270 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsMaxWindowWidth(maxWindowWidth); 1271 TAG_LOGI(AAFwkTag::TEST, 1272 "GetStartOptionsMaxWindowWidth_002 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 1273 resultErrorCode, expectedErrorCode); 1274 1275 // Assert 1276 EXPECT_EQ(expectedErrorCode, resultErrorCode); 1277 EXPECT_EQ(expectedMaxWindowWidth, maxWindowWidth); 1278 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMaxWindowWidth_002 end"); 1279 } 1280 1281 // Test cases 1282 // Test SetStartOptionsMinWindowHeight function - Normal case 1283 /** 1284 * @tc.name: SetStartOptionsMinWindowHeight_001 1285 * @tc.desc: test class StartOptions number function 1286 * @tc.type: FUNC 1287 */ 1288 HWTEST_F(StartOptionsImplTest, SetStartOptionsMinWindowHeight_001, testing::ext::TestSize.Level1) 1289 { 1290 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsMinWindowHeight_001 begin"); 1291 // Arrange 1292 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 1293 1294 // Act 1295 int32_t minWindowHeight = 100; 1296 AbilityRuntime_ErrorCode resultErrorCode = startOptions->SetStartOptionsMinWindowHeight(minWindowHeight); 1297 TAG_LOGI(AAFwkTag::TEST, 1298 "SetStartOptionsMinWindowHeight_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 1299 resultErrorCode, expectedErrorCode); 1300 1301 // Assert 1302 EXPECT_EQ(expectedErrorCode, resultErrorCode); 1303 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsMinWindowHeight_001 end"); 1304 } 1305 1306 // Test cases 1307 // Test GetStartOptionsMinWindowHeight function - Normal case 1308 /** 1309 * @tc.name: GetStartOptionsMinWindowHeight_001 1310 * @tc.desc: test class StartOptions number function 1311 * @tc.type: FUNC 1312 */ 1313 HWTEST_F(StartOptionsImplTest, GetStartOptionsMinWindowHeight_001, testing::ext::TestSize.Level1) 1314 { 1315 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMinWindowHeight_001 begin"); 1316 // Arrange 1317 int32_t expectedMinWindowHeight = 500; 1318 startOptions->SetStartOptionsMinWindowHeight(expectedMinWindowHeight); 1319 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 1320 1321 // Act 1322 int32_t minWindowHeight = 500; 1323 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsMinWindowHeight(minWindowHeight); 1324 TAG_LOGI(AAFwkTag::TEST, 1325 "GetStartOptionsMinWindowHeight_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 1326 resultErrorCode, expectedErrorCode); 1327 1328 // Assert 1329 EXPECT_EQ(expectedErrorCode, resultErrorCode); 1330 EXPECT_EQ(expectedMinWindowHeight, minWindowHeight); 1331 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMinWindowHeight_001 end"); 1332 } 1333 1334 // Test cases 1335 // Test GetStartOptionsMinWindowHeight function - Normal case 1336 /** 1337 * @tc.name: GetStartOptionsMinWindowHeight_002 1338 * @tc.desc: test class StartOptions number function 1339 * @tc.type: FUNC 1340 */ 1341 HWTEST_F(StartOptionsImplTest, GetStartOptionsMinWindowHeight_002, testing::ext::TestSize.Level1) 1342 { 1343 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMinWindowHeight_002 begin"); 1344 // Arrange 1345 int32_t expectedMinWindowHeight = 500; 1346 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 1347 1348 // Act 1349 int32_t minWindowHeight = 500; 1350 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsMinWindowHeight(minWindowHeight); 1351 TAG_LOGI(AAFwkTag::TEST, 1352 "GetStartOptionsMinWindowHeight_002 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 1353 resultErrorCode, expectedErrorCode); 1354 1355 // Assert 1356 EXPECT_EQ(expectedErrorCode, resultErrorCode); 1357 EXPECT_EQ(expectedMinWindowHeight, minWindowHeight); 1358 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMinWindowHeight_002 end"); 1359 } 1360 1361 // Test cases 1362 // Test SetStartOptionsMaxWindowHeight function - Normal case 1363 /** 1364 * @tc.name: SetStartOptionsMaxWindowHeight_001 1365 * @tc.desc: test class StartOptions number function 1366 * @tc.type: FUNC 1367 */ 1368 HWTEST_F(StartOptionsImplTest, SetStartOptionsMaxWindowHeight_001, testing::ext::TestSize.Level1) 1369 { 1370 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsMaxWindowHeight_001 begin"); 1371 // Arrange 1372 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 1373 1374 // Act 1375 int32_t maxWindowHeight = 100; 1376 AbilityRuntime_ErrorCode resultErrorCode = startOptions->SetStartOptionsMaxWindowHeight(maxWindowHeight); 1377 TAG_LOGI(AAFwkTag::TEST, 1378 "SetStartOptionsMaxWindowHeight_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 1379 resultErrorCode, expectedErrorCode); 1380 1381 // Assert 1382 EXPECT_EQ(expectedErrorCode, resultErrorCode); 1383 TAG_LOGI(AAFwkTag::TEST, "SetStartOptionsMaxWindowHeight_001 end"); 1384 } 1385 1386 // Test cases 1387 // Test GetStartOptionsMaxWindowHeight function - Normal case 1388 /** 1389 * @tc.name: GetStartOptionsMaxWindowHeight_001 1390 * @tc.desc: test class StartOptions number function 1391 * @tc.type: FUNC 1392 */ 1393 HWTEST_F(StartOptionsImplTest, GetStartOptionsMaxWindowHeight_001, testing::ext::TestSize.Level1) 1394 { 1395 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMaxWindowHeight_001 begin"); 1396 // Arrange 1397 int32_t expectedMaxWindowHeight = 500; 1398 startOptions->SetStartOptionsMaxWindowHeight(expectedMaxWindowHeight); 1399 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 1400 1401 // Act 1402 int32_t maxWindowHeight = 500; 1403 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsMaxWindowHeight(maxWindowHeight); 1404 TAG_LOGI(AAFwkTag::TEST, 1405 "GetStartOptionsMaxWindowHeight_001 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 1406 resultErrorCode, expectedErrorCode); 1407 1408 // Assert 1409 EXPECT_EQ(expectedErrorCode, resultErrorCode); 1410 EXPECT_EQ(expectedMaxWindowHeight, maxWindowHeight); 1411 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMaxWindowHeight_001 end"); 1412 } 1413 1414 // Test cases 1415 // Test GetStartOptionsMaxWindowHeight function - Normal case 1416 /** 1417 * @tc.name: GetStartOptionsMaxWindowHeight_002 1418 * @tc.desc: test class StartOptions number function 1419 * @tc.type: FUNC 1420 */ 1421 HWTEST_F(StartOptionsImplTest, GetStartOptionsMaxWindowHeight_002, testing::ext::TestSize.Level1) 1422 { 1423 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMaxWindowHeight_002 begin"); 1424 // Arrange 1425 int32_t expectedMaxWindowHeight = 500; 1426 AbilityRuntime_ErrorCode expectedErrorCode = ABILITY_RUNTIME_ERROR_CODE_NO_ERROR; 1427 1428 // Act 1429 int32_t maxWindowHeight = 500; 1430 AbilityRuntime_ErrorCode resultErrorCode = startOptions->GetStartOptionsMaxWindowHeight(maxWindowHeight); 1431 TAG_LOGI(AAFwkTag::TEST, 1432 "GetStartOptionsMaxWindowHeight_002 resultErrorCode=%{public}d,expectedErrorCode=%{public}d", 1433 resultErrorCode, expectedErrorCode); 1434 1435 // Assert 1436 EXPECT_EQ(expectedErrorCode, resultErrorCode); 1437 EXPECT_EQ(expectedMaxWindowHeight, maxWindowHeight); 1438 TAG_LOGI(AAFwkTag::TEST, "GetStartOptionsMaxWindowHeight_002 end"); 1439 } 1440