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 <gtest/gtest.h> 17 #include <libinput.h> 18 19 #include "multimodal_input_connect_stub.h" 20 #include "mmi_service.h" 21 22 namespace OHOS { 23 namespace MMI { 24 namespace { 25 using namespace testing::ext; 26 } // namespace 27 28 class MultimodalInputConnectStubTest : public testing::Test { 29 public: SetUpTestCase(void)30 static void SetUpTestCase(void) {} TearDownTestCase(void)31 static void TearDownTestCase(void) {} SetUp()32 void SetUp() {} TearDoen()33 void TearDoen() {} 34 }; 35 36 /** 37 * @tc.name: MultimodalInputConnectStubTest_StubSetMouseHotSpot 38 * @tc.desc: Test the function StubSetMouseHotSpot 39 * @tc.type: FUNC 40 * @tc.require: 41 */ 42 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetMouseHotSpot, TestSize.Level1) 43 { 44 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 45 std::shared_ptr<MMIService> service = std::static_pointer_cast<MMIService>(stub); 46 service->state_ = ServiceRunningState::STATE_NOT_START; 47 MessageParcel data; 48 MessageParcel reply; 49 int32_t pid = 100; 50 int32_t windowId = -1; 51 int32_t hotSpotX = 300; 52 int32_t hotSpotY = 300; 53 data.WriteInt32(pid); 54 data.WriteInt32(windowId); 55 EXPECT_EQ(stub->StubSetMouseHotSpot(data, reply), MMISERVICE_NOT_RUNNING); 56 service->state_ = ServiceRunningState::STATE_RUNNING; 57 EXPECT_NE(stub->StubSetMouseHotSpot(data, reply), RET_OK); 58 windowId = 30; 59 data.WriteInt32(pid); 60 data.WriteInt32(windowId); 61 data.WriteInt32(hotSpotX); 62 data.WriteInt32(hotSpotY); 63 EXPECT_NE(stub->StubSetMouseHotSpot(data, reply), RET_OK); 64 } 65 66 /** 67 * @tc.name: MultimodalInputConnectStubTest_StubGetMouseScrollRows 68 * @tc.desc: Test the function StubGetMouseScrollRows 69 * @tc.type: FUNC 70 * @tc.require: 71 */ 72 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubGetMouseScrollRows, TestSize.Level1) 73 { 74 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 75 std::shared_ptr<MMIService> service = std::static_pointer_cast<MMIService>(stub); 76 service->state_ = ServiceRunningState::STATE_NOT_START; 77 MessageParcel data; 78 MessageParcel reply; 79 EXPECT_EQ(stub->StubGetMouseScrollRows(data, reply), MMISERVICE_NOT_RUNNING); 80 81 service->state_ = ServiceRunningState::STATE_RUNNING; 82 EXPECT_NE(stub->StubGetMouseScrollRows(data, reply), RET_OK); 83 } 84 85 /** 86 * @tc.name: MultimodalInputConnectStubTest_StubSetPointerSize 87 * @tc.desc: Test the function StubSetPointerSize 88 * @tc.type: FUNC 89 * @tc.require: 90 */ 91 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetPointerSize, TestSize.Level1) 92 { 93 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 94 std::shared_ptr<MMIService> service = std::static_pointer_cast<MMIService>(stub); 95 service->state_ = ServiceRunningState::STATE_NOT_START; 96 MessageParcel data; 97 MessageParcel reply; 98 EXPECT_EQ(stub->StubSetPointerSize(data, reply), MMISERVICE_NOT_RUNNING); 99 int32_t size = 10; 100 data.WriteInt32(size); 101 service->state_ = ServiceRunningState::STATE_RUNNING; 102 EXPECT_NE(stub->StubSetPointerSize(data, reply), RET_OK); 103 } 104 105 /** 106 * @tc.name: MultimodalInputConnectStubTest_StubSetNapStatus 107 * @tc.desc: Test the function StubSetNapStatus 108 * @tc.type: FUNC 109 * @tc.require: 110 */ 111 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetNapStatus, TestSize.Level1) 112 { 113 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 114 std::shared_ptr<MMIService> service = std::static_pointer_cast<MMIService>(stub); 115 service->state_ = ServiceRunningState::STATE_NOT_START; 116 MessageParcel data; 117 MessageParcel reply; 118 EXPECT_EQ(stub->StubSetNapStatus(data, reply), MMISERVICE_NOT_RUNNING); 119 120 int32_t pid = 1000; 121 int32_t uid = 1500; 122 std::string bundleName = "abc"; 123 int32_t napStatus = 100; 124 data.WriteInt32(pid); 125 data.WriteInt32(uid); 126 data.WriteString(bundleName); 127 data.WriteInt32(napStatus); 128 service->state_ = ServiceRunningState::STATE_RUNNING; 129 EXPECT_NE(stub->StubSetNapStatus(data, reply), RET_OK); 130 } 131 132 /** 133 * @tc.name: MultimodalInputConnectStubTest_StubGetPointerSize 134 * @tc.desc: Test the function StubGetPointerSize 135 * @tc.type: FUNC 136 * @tc.require: 137 */ 138 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubGetPointerSize, TestSize.Level1) 139 { 140 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 141 std::shared_ptr<MMIService> service = std::static_pointer_cast<MMIService>(stub); 142 service->state_ = ServiceRunningState::STATE_NOT_START; 143 MessageParcel data; 144 MessageParcel reply; 145 EXPECT_EQ(stub->StubGetPointerSize(data, reply), MMISERVICE_NOT_RUNNING); 146 147 service->state_ = ServiceRunningState::STATE_RUNNING; 148 EXPECT_NE(stub->StubGetPointerSize(data, reply), RET_OK); 149 } 150 151 /** 152 * @tc.name: MultimodalInputConnectStubTest_StubSetMousePrimaryButton 153 * @tc.desc: Test the function StubSetMousePrimaryButton 154 * @tc.type: FUNC 155 * @tc.require: 156 */ 157 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetMousePrimaryButton, TestSize.Level1) 158 { 159 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 160 MessageParcel data; 161 MessageParcel reply; 162 int32_t primaryButton = 2072; 163 data.WriteInt32(primaryButton); 164 EXPECT_NE(stub->StubSetMousePrimaryButton(data, reply), RET_OK); 165 } 166 167 /** 168 * @tc.name: MultimodalInputConnectStubTest_StubSetHoverScrollState 169 * @tc.desc: Test the function StubSetHoverScrollState 170 * @tc.type: FUNC 171 * @tc.require: 172 */ 173 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetHoverScrollState, TestSize.Level1) 174 { 175 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 176 MessageParcel data; 177 MessageParcel reply; 178 bool state = false; 179 data.WriteBool(state); 180 EXPECT_NE(stub->StubSetHoverScrollState(data, reply), RET_OK); 181 } 182 183 /** 184 * @tc.name: MultimodalInputConnectStubTest_StubSetPointerVisible 185 * @tc.desc: Test the function StubSetPointerVisible 186 * @tc.type: FUNC 187 * @tc.require: 188 */ 189 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetPointerVisible, TestSize.Level1) 190 { 191 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 192 MessageParcel data; 193 MessageParcel reply; 194 bool visible = true; 195 int32_t priority = 1; 196 data.WriteBool(visible); 197 data.WriteInt32(priority); 198 EXPECT_NE(stub->StubSetPointerVisible(data, reply), RET_OK); 199 } 200 201 /** 202 * @tc.name: MultimodalInputConnectStubTest_StubMarkProcessed 203 * @tc.desc: Test the function StubMarkProcessed 204 * @tc.type: FUNC 205 * @tc.require: 206 */ 207 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubMarkProcessed, TestSize.Level1) 208 { 209 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 210 std::shared_ptr<MMIService> service = std::static_pointer_cast<MMIService>(stub); 211 service->state_ = ServiceRunningState::STATE_NOT_START; 212 MessageParcel data; 213 MessageParcel reply; 214 EXPECT_NE(stub->StubMarkProcessed(data, reply), RET_OK); 215 216 int32_t eventType = 1; 217 int32_t eventId = 100; 218 data.WriteInt32(eventType); 219 data.WriteInt32(eventId); 220 service->state_ = ServiceRunningState::STATE_RUNNING; 221 EXPECT_NE(stub->StubMarkProcessed(data, reply), RET_OK); 222 } 223 224 /** 225 * @tc.name: MultimodalInputConnectStubTest_StubSetPointerColor 226 * @tc.desc: Test the function StubSetPointerColor 227 * @tc.type: FUNC 228 * @tc.require: 229 */ 230 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetPointerColor, TestSize.Level1) 231 { 232 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 233 std::shared_ptr<MMIService> service = std::static_pointer_cast<MMIService>(stub); 234 service->state_ = ServiceRunningState::STATE_NOT_START; 235 MessageParcel data; 236 MessageParcel reply; 237 EXPECT_NE(stub->StubSetPointerColor(data, reply), RET_OK); 238 239 int32_t color = 123456; 240 data.WriteInt32(color); 241 service->state_ = ServiceRunningState::STATE_RUNNING; 242 EXPECT_NE(stub->StubSetPointerColor(data, reply), RET_OK); 243 } 244 245 /** 246 * @tc.name: MultimodalInputConnectStubTest_StubGetPointerColor 247 * @tc.desc: Test the function StubGetPointerColor 248 * @tc.type: FUNC 249 * @tc.require: 250 */ 251 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubGetPointerColor, TestSize.Level1) 252 { 253 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 254 std::shared_ptr<MMIService> service = std::static_pointer_cast<MMIService>(stub); 255 service->state_ = ServiceRunningState::STATE_NOT_START; 256 MessageParcel data; 257 MessageParcel reply; 258 EXPECT_NE(stub->StubGetPointerColor(data, reply), RET_OK); 259 service->state_ = ServiceRunningState::STATE_RUNNING; 260 EXPECT_NE(stub->StubGetPointerColor(data, reply), RET_OK); 261 } 262 263 /** 264 * @tc.name: MultimodalInputConnectStubTest_StubAddInputHandler 265 * @tc.desc: Test the function StubAddInputHandler 266 * @tc.type: FUNC 267 * @tc.require: 268 */ 269 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubAddInputHandler, TestSize.Level1) 270 { 271 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 272 std::shared_ptr<MMIService> service = std::static_pointer_cast<MMIService>(stub); 273 service->state_ = ServiceRunningState::STATE_NOT_START; 274 MessageParcel data; 275 MessageParcel reply; 276 EXPECT_NE(stub->StubAddInputHandler(data, reply), RET_OK); 277 278 int32_t handlerType = InputHandlerType::NONE; 279 uint32_t eventType = 0x1; 280 int32_t priority = 1; 281 uint32_t deviceTags = 100; 282 data.WriteInt32(handlerType); 283 data.WriteUint32(eventType); 284 data.WriteInt32(priority); 285 data.WriteUint32(deviceTags); 286 service->state_ = ServiceRunningState::STATE_RUNNING; 287 EXPECT_NE(stub->StubAddInputHandler(data, reply), RET_OK); 288 } 289 290 /** 291 * @tc.name: MultimodalInputConnectStubTest_OnRemoteRequest_001 292 * @tc.desc: Test the function OnRemoteRequest 293 * @tc.type: FUNC 294 * @tc.require: 295 */ 296 HWTEST_F(MultimodalInputConnectStubTest, OnRemoteRequest_001, TestSize.Level1) 297 { 298 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 299 MessageParcel data; 300 MessageParcel reply; 301 MessageOption option; 302 uint32_t code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::ALLOC_SOCKET_FD); 303 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 304 int32_t ret = stub->OnRemoteRequest(code, data, reply, option); 305 int32_t temp = stub->StubHandleAllocSocketFd(data, reply); 306 EXPECT_EQ(ret, temp); 307 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::ADD_INPUT_EVENT_FILTER); 308 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 309 ret = stub->OnRemoteRequest(code, data, reply, option); 310 temp = stub->StubAddInputEventFilter(data, reply); 311 EXPECT_EQ(ret, temp); 312 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::RMV_INPUT_EVENT_FILTER); 313 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 314 ret = stub->OnRemoteRequest(code, data, reply, option); 315 temp = stub->StubRemoveInputEventFilter(data, reply); 316 EXPECT_EQ(ret, temp); 317 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_MOUSE_SCROLL_ROWS); 318 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 319 ret = stub->OnRemoteRequest(code, data, reply, option); 320 temp = stub->StubSetMouseScrollRows(data, reply); 321 EXPECT_EQ(ret, temp); 322 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_MOUSE_SCROLL_ROWS); 323 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 324 ret = stub->OnRemoteRequest(code, data, reply, option); 325 temp = stub->StubGetMouseScrollRows(data, reply); 326 EXPECT_EQ(ret, temp); 327 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_POINTER_SIZE); 328 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 329 ret = stub->OnRemoteRequest(code, data, reply, option); 330 temp = stub->StubSetPointerSize(data, reply); 331 EXPECT_EQ(ret, temp); 332 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_POINTER_SIZE); 333 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 334 ret = stub->OnRemoteRequest(code, data, reply, option); 335 temp = stub->StubGetPointerSize(data, reply); 336 EXPECT_EQ(ret, temp); 337 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_CUSTOM_CURSOR); 338 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 339 ret = stub->OnRemoteRequest(code, data, reply, option); 340 temp = stub->StubSetCustomCursor(data, reply); 341 EXPECT_EQ(ret, temp); 342 } 343 344 /** 345 * @tc.name: MultimodalInputConnectStubTest_OnRemoteRequest_002 346 * @tc.desc: Test the function OnRemoteRequest 347 * @tc.type: FUNC 348 * @tc.require: 349 */ 350 HWTEST_F(MultimodalInputConnectStubTest, OnRemoteRequest_002, TestSize.Level1) 351 { 352 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 353 MessageParcel data; 354 MessageParcel reply; 355 MessageOption option; 356 uint32_t code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_MOUSE_ICON); 357 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 358 int32_t ret = stub->OnRemoteRequest(code, data, reply, option); 359 int32_t temp = stub->StubSetMouseIcon(data, reply); 360 EXPECT_EQ(ret, temp); 361 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_MOUSE_PRIMARY_BUTTON); 362 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 363 ret = stub->OnRemoteRequest(code, data, reply, option); 364 temp = stub->StubSetMousePrimaryButton(data, reply); 365 EXPECT_EQ(ret, temp); 366 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_MOUSE_PRIMARY_BUTTON); 367 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 368 ret = stub->OnRemoteRequest(code, data, reply, option); 369 temp = stub->StubGetMousePrimaryButton(data, reply); 370 EXPECT_EQ(ret, temp); 371 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_HOVER_SCROLL_STATE); 372 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 373 ret = stub->OnRemoteRequest(code, data, reply, option); 374 temp = stub->StubSetHoverScrollState(data, reply); 375 EXPECT_EQ(ret, temp); 376 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_HOVER_SCROLL_STATE); 377 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 378 ret = stub->OnRemoteRequest(code, data, reply, option); 379 temp = stub->StubGetHoverScrollState(data, reply); 380 EXPECT_EQ(ret, temp); 381 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_POINTER_VISIBLE); 382 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 383 ret = stub->OnRemoteRequest(code, data, reply, option); 384 temp = stub->StubSetPointerVisible(data, reply); 385 EXPECT_EQ(ret, temp); 386 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_POINTER_STYLE); 387 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 388 ret = stub->OnRemoteRequest(code, data, reply, option); 389 temp = stub->StubSetPointerStyle(data, reply); 390 EXPECT_EQ(ret, temp); 391 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::NOTIFY_NAP_ONLINE); 392 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 393 ret = stub->OnRemoteRequest(code, data, reply, option); 394 temp = stub->StubNotifyNapOnline(data, reply); 395 EXPECT_EQ(ret, temp); 396 } 397 398 /** 399 * @tc.name: MultimodalInputConnectStubTest_OnRemoteRequest_003 400 * @tc.desc: Test the function OnRemoteRequest 401 * @tc.type: FUNC 402 * @tc.require: 403 */ 404 HWTEST_F(MultimodalInputConnectStubTest, OnRemoteRequest_003, TestSize.Level1) 405 { 406 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 407 MessageParcel data; 408 MessageParcel reply; 409 MessageOption option; 410 uint32_t code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::RMV_INPUT_EVENT_OBSERVER); 411 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 412 int32_t ret = stub->OnRemoteRequest(code, data, reply, option); 413 int32_t temp = stub->StubRemoveInputEventObserver(data, reply); 414 EXPECT_EQ(ret, temp); 415 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_NAP_STATUS); 416 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 417 ret = stub->OnRemoteRequest(code, data, reply, option); 418 temp = stub->StubSetNapStatus(data, reply); 419 EXPECT_EQ(ret, temp); 420 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::CLEAN_WIDNOW_STYLE); 421 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 422 ret = stub->OnRemoteRequest(code, data, reply, option); 423 temp = stub->StubClearWindowPointerStyle(data, reply); 424 EXPECT_EQ(ret, temp); 425 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_POINTER_STYLE); 426 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 427 ret = stub->OnRemoteRequest(code, data, reply, option); 428 temp = stub->StubGetPointerStyle(data, reply); 429 EXPECT_EQ(ret, temp); 430 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::IS_POINTER_VISIBLE); 431 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 432 ret = stub->OnRemoteRequest(code, data, reply, option); 433 temp = stub->StubIsPointerVisible(data, reply); 434 EXPECT_EQ(ret, temp); 435 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::REGISTER_DEV_MONITOR); 436 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 437 ret = stub->OnRemoteRequest(code, data, reply, option); 438 temp = stub->StubRegisterInputDeviceMonitor(data, reply); 439 EXPECT_EQ(ret, temp); 440 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::REGISTER_DEV_MONITOR); 441 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 442 ret = stub->OnRemoteRequest(code, data, reply, option); 443 temp = stub->StubRegisterInputDeviceMonitor(data, reply); 444 EXPECT_EQ(ret, temp); 445 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::UNREGISTER_DEV_MONITOR); 446 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 447 ret = stub->OnRemoteRequest(code, data, reply, option); 448 temp = stub->StubUnregisterInputDeviceMonitor(data, reply); 449 EXPECT_EQ(ret, temp); 450 } 451 452 /** 453 * @tc.name: MultimodalInputConnectStubTest_OnRemoteRequest_004 454 * @tc.desc: Test the function OnRemoteRequest 455 * @tc.type: FUNC 456 * @tc.require: 457 */ 458 HWTEST_F(MultimodalInputConnectStubTest, OnRemoteRequest_004, TestSize.Level1) 459 { 460 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 461 MessageParcel data; 462 MessageParcel reply; 463 MessageOption option; 464 uint32_t code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_DEVICE_IDS); 465 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 466 int32_t ret = stub->OnRemoteRequest(code, data, reply, option); 467 int32_t temp = stub->StubGetDeviceIds(data, reply); 468 EXPECT_EQ(ret, temp); 469 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_DEVICE); 470 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 471 ret = stub->OnRemoteRequest(code, data, reply, option); 472 temp = stub->StubGetDevice(data, reply); 473 EXPECT_EQ(ret, temp); 474 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SUPPORT_KEYS); 475 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 476 ret = stub->OnRemoteRequest(code, data, reply, option); 477 temp = stub->StubSupportKeys(data, reply); 478 EXPECT_EQ(ret, temp); 479 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_KEYBOARD_TYPE); 480 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 481 ret = stub->OnRemoteRequest(code, data, reply, option); 482 temp = stub->StubGetKeyboardType(data, reply); 483 EXPECT_EQ(ret, temp); 484 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_POINTER_COLOR); 485 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 486 ret = stub->OnRemoteRequest(code, data, reply, option); 487 temp = stub->StubSetPointerColor(data, reply); 488 EXPECT_EQ(ret, temp); 489 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_POINTER_COLOR); 490 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 491 ret = stub->OnRemoteRequest(code, data, reply, option); 492 temp = stub->StubGetPointerColor(data, reply); 493 EXPECT_EQ(ret, temp); 494 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_POINTER_SPEED); 495 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 496 ret = stub->OnRemoteRequest(code, data, reply, option); 497 temp = stub->StubSetPointerSpeed(data, reply); 498 EXPECT_EQ(ret, temp); 499 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_POINTER_SPEED); 500 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 501 ret = stub->OnRemoteRequest(code, data, reply, option); 502 temp = stub->StubGetPointerSpeed(data, reply); 503 EXPECT_EQ(ret, temp); 504 } 505 506 /** 507 * @tc.name: MultimodalInputConnectStubTest_OnRemoteRequest_005 508 * @tc.desc: Test the function OnRemoteRequest 509 * @tc.type: FUNC 510 * @tc.require: 511 */ 512 HWTEST_F(MultimodalInputConnectStubTest, OnRemoteRequest_005, TestSize.Level1) 513 { 514 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 515 MessageParcel data; 516 MessageParcel reply; 517 MessageOption option; 518 uint32_t code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SUBSCRIBE_KEY_EVENT); 519 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 520 int32_t ret = stub->OnRemoteRequest(code, data, reply, option); 521 int32_t temp = stub->StubSubscribeKeyEvent(data, reply); 522 EXPECT_EQ(ret, temp); 523 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::UNSUBSCRIBE_KEY_EVENT); 524 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 525 ret = stub->OnRemoteRequest(code, data, reply, option); 526 temp = stub->StubUnsubscribeKeyEvent(data, reply); 527 EXPECT_EQ(ret, temp); 528 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SUBSCRIBE_SWITCH_EVENT); 529 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 530 ret = stub->OnRemoteRequest(code, data, reply, option); 531 temp = stub->StubSubscribeSwitchEvent(data, reply); 532 EXPECT_EQ(ret, temp); 533 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::UNSUBSCRIBE_SWITCH_EVENT); 534 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 535 ret = stub->OnRemoteRequest(code, data, reply, option); 536 temp = stub->StubUnsubscribeSwitchEvent(data, reply); 537 EXPECT_EQ(ret, temp); 538 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::MARK_PROCESSED); 539 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 540 ret = stub->OnRemoteRequest(code, data, reply, option); 541 temp = stub->StubMarkProcessed(data, reply); 542 EXPECT_EQ(ret, temp); 543 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::ADD_INPUT_HANDLER); 544 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 545 ret = stub->OnRemoteRequest(code, data, reply, option); 546 temp = stub->StubAddInputHandler(data, reply); 547 EXPECT_EQ(ret, temp); 548 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::REMOVE_INPUT_HANDLER); 549 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 550 ret = stub->OnRemoteRequest(code, data, reply, option); 551 temp = stub->StubRemoveInputHandler(data, reply); 552 EXPECT_EQ(ret, temp); 553 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::MARK_EVENT_CONSUMED); 554 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 555 ret = stub->OnRemoteRequest(code, data, reply, option); 556 temp = stub->StubMarkEventConsumed(data, reply); 557 EXPECT_EQ(ret, temp); 558 } 559 560 /** 561 * @tc.name: MultimodalInputConnectStubTest_OnRemoteRequest_006 562 * @tc.desc: Test the function OnRemoteRequest 563 * @tc.type: FUNC 564 * @tc.require: 565 */ 566 HWTEST_F(MultimodalInputConnectStubTest, OnRemoteRequest_006, TestSize.Level1) 567 { 568 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 569 MessageParcel data; 570 MessageParcel reply; 571 MessageOption option; 572 uint32_t code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::MOVE_MOUSE); 573 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 574 int32_t ret = stub->OnRemoteRequest(code, data, reply, option); 575 int32_t temp = stub->StubMoveMouseEvent(data, reply); 576 EXPECT_EQ(ret, temp); 577 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::INJECT_KEY_EVENT); 578 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 579 ret = stub->OnRemoteRequest(code, data, reply, option); 580 temp = stub->StubInjectKeyEvent(data, reply); 581 EXPECT_EQ(ret, temp); 582 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::INJECT_POINTER_EVENT); 583 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 584 ret = stub->OnRemoteRequest(code, data, reply, option); 585 temp = stub->StubInjectPointerEvent(data, reply); 586 EXPECT_EQ(ret, temp); 587 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_ANR_OBSERVER); 588 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 589 ret = stub->OnRemoteRequest(code, data, reply, option); 590 temp = stub->StubSetAnrListener(data, reply); 591 EXPECT_EQ(ret, temp); 592 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_DISPLAY_BIND_INFO); 593 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 594 ret = stub->OnRemoteRequest(code, data, reply, option); 595 temp = stub->StubGetDisplayBindInfo(data, reply); 596 EXPECT_EQ(ret, temp); 597 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_ALL_NAPSTATUS_DATA); 598 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 599 ret = stub->OnRemoteRequest(code, data, reply, option); 600 temp = stub->StubGetAllMmiSubscribedEvents(data, reply); 601 EXPECT_EQ(ret, temp); 602 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_DISPLAY_BIND); 603 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 604 ret = stub->OnRemoteRequest(code, data, reply, option); 605 temp = stub->StubSetDisplayBind(data, reply); 606 EXPECT_EQ(ret, temp); 607 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_FUNCTION_KEY_STATE); 608 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 609 ret = stub->OnRemoteRequest(code, data, reply, option); 610 temp = stub->StubGetFunctionKeyState(data, reply); 611 EXPECT_EQ(ret, temp); 612 } 613 614 /** 615 * @tc.name: MultimodalInputConnectStubTest_OnRemoteRequest_007 616 * @tc.desc: Test the function OnRemoteRequest 617 * @tc.type: FUNC 618 * @tc.require: 619 */ 620 HWTEST_F(MultimodalInputConnectStubTest, OnRemoteRequest_007, TestSize.Level1) 621 { 622 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 623 MessageParcel data; 624 MessageParcel reply; 625 MessageOption option; 626 uint32_t code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_FUNCTION_KEY_STATE); 627 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 628 int32_t ret = stub->OnRemoteRequest(code, data, reply, option); 629 int32_t temp = stub->StubSetFunctionKeyState(data, reply); 630 EXPECT_EQ(ret, temp); 631 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_POINTER_LOCATION); 632 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 633 ret = stub->OnRemoteRequest(code, data, reply, option); 634 temp = stub->StubSetPointerLocation(data, reply); 635 EXPECT_EQ(ret, temp); 636 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_CAPTURE_MODE); 637 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 638 ret = stub->OnRemoteRequest(code, data, reply, option); 639 temp = stub->StubSetMouseCaptureMode(data, reply); 640 EXPECT_EQ(ret, temp); 641 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_WINDOW_PID); 642 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 643 ret = stub->OnRemoteRequest(code, data, reply, option); 644 temp = stub->StubGetWindowPid(data, reply); 645 EXPECT_EQ(ret, temp); 646 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::APPEND_EXTRA_DATA); 647 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 648 ret = stub->OnRemoteRequest(code, data, reply, option); 649 temp = stub->StubAppendExtraData(data, reply); 650 EXPECT_EQ(ret, temp); 651 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::ENABLE_INPUT_DEVICE); 652 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 653 ret = stub->OnRemoteRequest(code, data, reply, option); 654 temp = stub->StubEnableInputDevice(data, reply); 655 EXPECT_EQ(ret, temp); 656 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::ENABLE_COMBINE_KEY); 657 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 658 ret = stub->OnRemoteRequest(code, data, reply, option); 659 temp = stub->StubEnableCombineKey(data, reply); 660 EXPECT_EQ(ret, temp); 661 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_KEY_DOWN_DURATION); 662 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 663 ret = stub->OnRemoteRequest(code, data, reply, option); 664 temp = stub->StubSetKeyDownDuration(data, reply); 665 EXPECT_EQ(ret, temp); 666 } 667 668 /** 669 * @tc.name: MultimodalInputConnectStubTest_OnRemoteRequest_008 670 * @tc.desc: Test the function OnRemoteRequest 671 * @tc.type: FUNC 672 * @tc.require: 673 */ 674 HWTEST_F(MultimodalInputConnectStubTest, OnRemoteRequest_008, TestSize.Level1) 675 { 676 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 677 MessageParcel data; 678 MessageParcel reply; 679 MessageOption option; 680 uint32_t code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_TP_SCROLL_SWITCH); 681 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 682 int32_t ret = stub->OnRemoteRequest(code, data, reply, option); 683 int32_t temp = stub->StubSetTouchpadScrollSwitch(data, reply); 684 EXPECT_EQ(ret, temp); 685 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_TP_SCROLL_SWITCH); 686 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 687 ret = stub->OnRemoteRequest(code, data, reply, option); 688 temp = stub->StubGetTouchpadScrollSwitch(data, reply); 689 EXPECT_EQ(ret, temp); 690 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_TP_SCROLL_DIRECT_SWITCH); 691 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 692 ret = stub->OnRemoteRequest(code, data, reply, option); 693 temp = stub->StubSetTouchpadScrollDirection(data, reply); 694 EXPECT_EQ(ret, temp); 695 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_TP_SCROLL_DIRECT_SWITCH); 696 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 697 ret = stub->OnRemoteRequest(code, data, reply, option); 698 temp = stub->StubGetTouchpadScrollDirection(data, reply); 699 EXPECT_EQ(ret, temp); 700 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_TP_TAP_SWITCH); 701 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 702 ret = stub->OnRemoteRequest(code, data, reply, option); 703 temp = stub->StubSetTouchpadTapSwitch(data, reply); 704 EXPECT_EQ(ret, temp); 705 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_TP_TAP_SWITCH); 706 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 707 ret = stub->OnRemoteRequest(code, data, reply, option); 708 temp = stub->StubGetTouchpadTapSwitch(data, reply); 709 EXPECT_EQ(ret, temp); 710 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_TP_POINTER_SPEED); 711 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 712 ret = stub->OnRemoteRequest(code, data, reply, option); 713 temp = stub->StubSetTouchpadPointerSpeed(data, reply); 714 EXPECT_EQ(ret, temp); 715 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_TP_POINTER_SPEED); 716 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 717 ret = stub->OnRemoteRequest(code, data, reply, option); 718 temp = stub->StubGetTouchpadPointerSpeed(data, reply); 719 EXPECT_EQ(ret, temp); 720 } 721 722 /** 723 * @tc.name: MultimodalInputConnectStubTest_OnRemoteRequest_009 724 * @tc.desc: Test the function OnRemoteRequest 725 * @tc.type: FUNC 726 * @tc.require: 727 */ 728 HWTEST_F(MultimodalInputConnectStubTest, OnRemoteRequest_009, TestSize.Level1) 729 { 730 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 731 MessageParcel data; 732 MessageParcel reply; 733 MessageOption option; 734 uint32_t code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_KEYBOARD_REPEAT_DELAY); 735 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 736 int32_t ret = stub->OnRemoteRequest(code, data, reply, option); 737 int32_t temp = stub->StubSetKeyboardRepeatDelay(data, reply); 738 EXPECT_EQ(ret, temp); 739 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_KEYBOARD_REPEAT_RATE); 740 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 741 ret = stub->OnRemoteRequest(code, data, reply, option); 742 temp = stub->StubSetKeyboardRepeatRate(data, reply); 743 EXPECT_EQ(ret, temp); 744 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_TP_PINCH_SWITCH); 745 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 746 ret = stub->OnRemoteRequest(code, data, reply, option); 747 temp = stub->StubSetTouchpadPinchSwitch(data, reply); 748 EXPECT_EQ(ret, temp); 749 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_TP_PINCH_SWITCH); 750 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 751 ret = stub->OnRemoteRequest(code, data, reply, option); 752 temp = stub->StubGetTouchpadPinchSwitch(data, reply); 753 EXPECT_EQ(ret, temp); 754 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_TP_SWIPE_SWITCH); 755 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 756 ret = stub->OnRemoteRequest(code, data, reply, option); 757 temp = stub->StubSetTouchpadSwipeSwitch(data, reply); 758 EXPECT_EQ(ret, temp); 759 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_TP_SWIPE_SWITCH); 760 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 761 ret = stub->OnRemoteRequest(code, data, reply, option); 762 temp = stub->StubGetTouchpadSwipeSwitch(data, reply); 763 EXPECT_EQ(ret, temp); 764 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_TP_RIGHT_CLICK_TYPE); 765 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 766 ret = stub->OnRemoteRequest(code, data, reply, option); 767 temp = stub->StubSetTouchpadRightClickType(data, reply); 768 EXPECT_EQ(ret, temp); 769 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_TP_RIGHT_CLICK_TYPE); 770 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 771 ret = stub->OnRemoteRequest(code, data, reply, option); 772 temp = stub->StubGetTouchpadRightClickType(data, reply); 773 EXPECT_EQ(ret, temp); 774 } 775 776 /** 777 * @tc.name: MultimodalInputConnectStubTest_OnRemoteRequest_010 778 * @tc.desc: Test the function OnRemoteRequest 779 * @tc.type: FUNC 780 * @tc.require: 781 */ 782 HWTEST_F(MultimodalInputConnectStubTest, OnRemoteRequest_010, TestSize.Level1) 783 { 784 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 785 MessageParcel data; 786 MessageParcel reply; 787 MessageOption option; 788 uint32_t code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_KEYBOARD_REPEAT_DELAY); 789 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 790 int32_t ret = stub->OnRemoteRequest(code, data, reply, option); 791 int32_t temp = stub->StubGetKeyboardRepeatDelay(data, reply); 792 EXPECT_EQ(ret, temp); 793 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_KEYBOARD_REPEAT_RATE); 794 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 795 ret = stub->OnRemoteRequest(code, data, reply, option); 796 temp = stub->StubGetKeyboardRepeatRate(data, reply); 797 EXPECT_EQ(ret, temp); 798 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_MOUSE_HOT_SPOT); 799 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 800 ret = stub->OnRemoteRequest(code, data, reply, option); 801 temp = stub->StubSetMouseHotSpot(data, reply); 802 EXPECT_EQ(ret, temp); 803 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_SHIELD_STATUS); 804 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 805 ret = stub->OnRemoteRequest(code, data, reply, option); 806 temp = stub->StubSetShieldStatus(data, reply); 807 EXPECT_EQ(ret, temp); 808 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_SHIELD_STATUS); 809 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 810 ret = stub->OnRemoteRequest(code, data, reply, option); 811 temp = stub->StubGetShieldStatus(data, reply); 812 EXPECT_EQ(ret, temp); 813 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::GET_KEY_STATE); 814 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 815 ret = stub->OnRemoteRequest(code, data, reply, option); 816 temp = stub->StubGetKeyState(data, reply); 817 EXPECT_EQ(ret, temp); 818 } 819 820 /** 821 * @tc.name: MultimodalInputConnectStubTest_OnRemoteRequest_011 822 * @tc.desc: Test the function OnRemoteRequest 823 * @tc.type: FUNC 824 * @tc.require: 825 */ 826 HWTEST_F(MultimodalInputConnectStubTest, OnRemoteRequest_011, TestSize.Level1) 827 { 828 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 829 MessageParcel data; 830 MessageParcel reply; 831 MessageOption option; 832 uint32_t code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::NATIVE_AUTHORIZE); 833 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 834 int32_t ret = stub->OnRemoteRequest(code, data, reply, option); 835 int32_t temp = stub->StubAuthorize(data, reply); 836 EXPECT_EQ(ret, temp); 837 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::NATIVE_CANCEL_INJECTION); 838 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 839 ret = stub->OnRemoteRequest(code, data, reply, option); 840 temp = stub->StubCancelInjection(data, reply); 841 EXPECT_EQ(ret, temp); 842 code = static_cast<uint32_t>(MultimodalinputConnectInterfaceCode::SET_PIXEL_MAP_DATA); 843 data.WriteInterfaceToken(IMultimodalInputConnect::GetDescriptor()); 844 ret = stub->OnRemoteRequest(code, data, reply, option); 845 temp = stub->StubSetPixelMapData(data, reply); 846 EXPECT_EQ(ret, temp); 847 } 848 849 /** 850 * @tc.name: StubHandleAllocSocketFd_001 851 * @tc.desc: Test the function StubHandleAllocSocketFd 852 * @tc.type: FUNC 853 * @tc.require: 854 */ 855 HWTEST_F(MultimodalInputConnectStubTest, StubHandleAllocSocketFd_001, TestSize.Level1) 856 { 857 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 858 MessageParcel data; 859 MessageParcel reply; 860 int32_t returnCode = 65142800; 861 int32_t ret = stub->StubHandleAllocSocketFd(data, reply); 862 EXPECT_EQ(ret, returnCode); 863 } 864 865 /** 866 * @tc.name: StubAddInputEventFilter_001 867 * @tc.desc: Test the function StubAddInputEventFilter 868 * @tc.type: FUNC 869 * @tc.require: 870 */ 871 HWTEST_F(MultimodalInputConnectStubTest, StubAddInputEventFilter_001, TestSize.Level1) 872 { 873 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 874 MessageParcel data; 875 MessageParcel reply; 876 int32_t returnCode = 22; 877 int32_t ret = stub->StubAddInputEventFilter(data, reply); 878 EXPECT_EQ(ret, returnCode); 879 } 880 881 /** 882 * @tc.name: StubRemoveInputEventFilter_001 883 * @tc.desc: Test the function StubRemoveInputEventFilter 884 * @tc.type: FUNC 885 * @tc.require: 886 */ 887 HWTEST_F(MultimodalInputConnectStubTest, StubRemoveInputEventFilter_001, TestSize.Level1) 888 { 889 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 890 MessageParcel data; 891 MessageParcel reply; 892 int32_t returnCode = 201; 893 int32_t ret = stub->StubRemoveInputEventFilter(data, reply); 894 EXPECT_EQ(ret, returnCode); 895 } 896 897 /** 898 * @tc.name: StubSetMouseScrollRows_001 899 * @tc.desc: Test the function StubSetMouseScrollRows 900 * @tc.type: FUNC 901 * @tc.require: 902 */ 903 HWTEST_F(MultimodalInputConnectStubTest, StubSetMouseScrollRows_001, TestSize.Level1) 904 { 905 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 906 MessageParcel data; 907 MessageParcel reply; 908 int32_t returnCode = 65142800; 909 int32_t ret = stub->StubSetMouseScrollRows(data, reply); 910 EXPECT_EQ(ret, returnCode); 911 } 912 913 /** 914 * @tc.name: StubSetCustomCursor_001 915 * @tc.desc: Test the function StubSetCustomCursor 916 * @tc.type: FUNC 917 * @tc.require: 918 */ 919 HWTEST_F(MultimodalInputConnectStubTest, StubSetCustomCursor_001, TestSize.Level1) 920 { 921 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 922 MessageParcel data; 923 MessageParcel reply; 924 int32_t returnCode = 65142800; 925 int32_t ret = stub->StubSetCustomCursor(data, reply); 926 EXPECT_EQ(ret, returnCode); 927 } 928 929 /** 930 * @tc.name: StubSetMouseIcon_001 931 * @tc.desc: Test the function StubSetMouseIcon 932 * @tc.type: FUNC 933 * @tc.require: 934 */ 935 HWTEST_F(MultimodalInputConnectStubTest, StubSetMouseIcon_001, TestSize.Level1) 936 { 937 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 938 MessageParcel data; 939 MessageParcel reply; 940 int32_t returnCode = 65142800; 941 int32_t ret = stub->StubSetMouseIcon(data, reply); 942 EXPECT_EQ(ret, returnCode); 943 } 944 945 /** 946 * @tc.name: StubSetMouseHotSpot_001 947 * @tc.desc: Test the function StubSetMouseHotSpot 948 * @tc.type: FUNC 949 * @tc.require: 950 */ 951 HWTEST_F(MultimodalInputConnectStubTest, StubSetMouseHotSpot_001, TestSize.Level1) 952 { 953 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 954 MessageParcel data; 955 MessageParcel reply; 956 int32_t returnCode = 65142800; 957 int32_t ret = stub->StubSetMouseHotSpot(data, reply); 958 EXPECT_EQ(ret, returnCode); 959 } 960 961 /** 962 * @tc.name: StubGetMouseScrollRows_001 963 * @tc.desc: Test the function StubGetMouseScrollRows 964 * @tc.type: FUNC 965 * @tc.require: 966 */ 967 HWTEST_F(MultimodalInputConnectStubTest, StubGetMouseScrollRows_001, TestSize.Level1) 968 { 969 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 970 MessageParcel data; 971 MessageParcel reply; 972 int32_t returnCode = 65142800; 973 int32_t ret = stub->StubGetMouseScrollRows(data, reply); 974 EXPECT_EQ(ret, returnCode); 975 } 976 977 /** 978 * @tc.name: StubSetPointerSize_001 979 * @tc.desc: Test the function StubSetPointerSize 980 * @tc.type: FUNC 981 * @tc.require: 982 */ 983 HWTEST_F(MultimodalInputConnectStubTest, StubSetPointerSize_001, TestSize.Level1) 984 { 985 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 986 MessageParcel data; 987 MessageParcel reply; 988 int32_t returnCode = 65142800; 989 int32_t ret = stub->StubSetPointerSize(data, reply); 990 EXPECT_EQ(ret, returnCode); 991 } 992 993 /** 994 * @tc.name: StubSetNapStatus_001 995 * @tc.desc: Test the function StubSetNapStatus 996 * @tc.type: FUNC 997 * @tc.require: 998 */ 999 HWTEST_F(MultimodalInputConnectStubTest, StubSetNapStatus_001, TestSize.Level1) 1000 { 1001 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1002 MessageParcel data; 1003 MessageParcel reply; 1004 int32_t returnCode = 65142800; 1005 int32_t ret = stub->StubSetNapStatus(data, reply); 1006 EXPECT_EQ(ret, returnCode); 1007 } 1008 1009 /** 1010 * @tc.name: StubGetPointerSize_001 1011 * @tc.desc: Test the function StubGetPointerSize 1012 * @tc.type: FUNC 1013 * @tc.require: 1014 */ 1015 HWTEST_F(MultimodalInputConnectStubTest, StubGetPointerSize_001, TestSize.Level1) 1016 { 1017 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1018 MessageParcel data; 1019 MessageParcel reply; 1020 int32_t returnCode = 65142800; 1021 int32_t ret = stub->StubGetPointerSize(data, reply); 1022 EXPECT_EQ(ret, returnCode); 1023 } 1024 1025 /** 1026 * @tc.name: MultimodalInputConnectStubTest_StubGetPointerSize_002 1027 * @tc.desc: Test the function StubGetPointerSize 1028 * @tc.type: FUNC 1029 * @tc.require: 1030 */ 1031 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubGetPointerSize_002, TestSize.Level1) 1032 { 1033 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1034 MessageParcel data; 1035 MessageParcel reply; 1036 std::atomic<ServiceRunningState> state_ = ServiceRunningState::STATE_NOT_START; 1037 int32_t ret = stub->StubGetPointerSize(data, reply); 1038 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 1039 state_ = ServiceRunningState::STATE_RUNNING; 1040 ret = stub->StubGetPointerSize(data, reply); 1041 EXPECT_NE(ret, RET_OK); 1042 } 1043 1044 /** 1045 * @tc.name: MultimodalInputConnectStubTest_StubSetMousePrimaryButton_001 1046 * @tc.desc: Test the function StubSetMousePrimaryButton 1047 * @tc.type: FUNC 1048 * @tc.require: 1049 */ 1050 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetMousePrimaryButton_001, TestSize.Level1) 1051 { 1052 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1053 MessageParcel data; 1054 MessageParcel reply; 1055 int32_t ret = stub->StubSetMousePrimaryButton(data, reply); 1056 EXPECT_NE(ret, RET_OK); 1057 } 1058 1059 /** 1060 * @tc.name: MultimodalInputConnectStubTest_StubGetMousePrimaryButton_001 1061 * @tc.desc: Test the function StubGetMousePrimaryButton 1062 * @tc.type: FUNC 1063 * @tc.require: 1064 */ 1065 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubGetMousePrimaryButton_001, TestSize.Level1) 1066 { 1067 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1068 MessageParcel data; 1069 MessageParcel reply; 1070 int32_t returnCode = 65142804; 1071 int32_t ret = stub->StubGetMousePrimaryButton(data, reply); 1072 EXPECT_EQ(ret, returnCode); 1073 } 1074 1075 /** 1076 * @tc.name: MultimodalInputConnectStubTest_StubSetHoverScrollState_001 1077 * @tc.desc: Test the function StubSetHoverScrollState 1078 * @tc.type: FUNC 1079 * @tc.require: 1080 */ 1081 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetHoverScrollState_001, TestSize.Level1) 1082 { 1083 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1084 MessageParcel data; 1085 MessageParcel reply; 1086 int32_t ret = stub->StubSetHoverScrollState(data, reply); 1087 EXPECT_NE(ret, RET_OK); 1088 } 1089 1090 /** 1091 * @tc.name: MultimodalInputConnectStubTest_StubGetHoverScrollState_001 1092 * @tc.desc: Test the function StubGetHoverScrollState 1093 * @tc.type: FUNC 1094 * @tc.require: 1095 */ 1096 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubGetHoverScrollState_001, TestSize.Level1) 1097 { 1098 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1099 MessageParcel data; 1100 MessageParcel reply; 1101 int32_t ret = stub->StubGetHoverScrollState(data, reply); 1102 EXPECT_NE(ret, RET_OK); 1103 } 1104 1105 /** 1106 * @tc.name: MultimodalInputConnectStubTest_StubSetPointerVisible_001 1107 * @tc.desc: Test the function StubSetPointerVisible 1108 * @tc.type: FUNC 1109 * @tc.require: 1110 */ 1111 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetPointerVisible_001, TestSize.Level1) 1112 { 1113 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1114 MessageParcel data; 1115 MessageParcel reply; 1116 int32_t ret = stub->StubSetPointerVisible(data, reply); 1117 EXPECT_NE(ret, RET_OK); 1118 } 1119 1120 /** 1121 * @tc.name: MultimodalInputConnectStubTest_StubIsPointerVisible_001 1122 * @tc.desc: Test the function StubIsPointerVisible 1123 * @tc.type: FUNC 1124 * @tc.require: 1125 */ 1126 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubIsPointerVisible_001, TestSize.Level1) 1127 { 1128 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1129 MessageParcel data; 1130 MessageParcel reply; 1131 int32_t returnCode = 65142804; 1132 int32_t ret = stub->StubIsPointerVisible(data, reply); 1133 EXPECT_EQ(ret, returnCode); 1134 } 1135 1136 /** 1137 * @tc.name: MultimodalInputConnectStubTest_StubMarkProcessed_001 1138 * @tc.desc: Test the function StubMarkProcessed 1139 * @tc.type: FUNC 1140 * @tc.require: 1141 */ 1142 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubMarkProcessed_001, TestSize.Level1) 1143 { 1144 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1145 MessageParcel data; 1146 MessageParcel reply; 1147 int32_t ret = stub->StubMarkProcessed(data, reply); 1148 EXPECT_NE(ret, RET_OK); 1149 } 1150 1151 /** 1152 * @tc.name: MultimodalInputConnectStubTest_StubSetPointerColor_001 1153 * @tc.desc: Test the function StubSetPointerColor 1154 * @tc.type: FUNC 1155 * @tc.require: 1156 */ 1157 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetPointerColor_001, TestSize.Level1) 1158 { 1159 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1160 MessageParcel data; 1161 MessageParcel reply; 1162 std::atomic<ServiceRunningState> state_ = ServiceRunningState::STATE_NOT_START; 1163 int32_t ret = stub->StubSetPointerColor(data, reply); 1164 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 1165 state_ = ServiceRunningState::STATE_RUNNING; 1166 ret = stub->StubSetPointerColor(data, reply); 1167 EXPECT_NE(ret, RET_OK); 1168 } 1169 1170 /** 1171 * @tc.name: MultimodalInputConnectStubTest_StubGetPointerColor_001 1172 * @tc.desc: Test the function StubGetPointerColor 1173 * @tc.type: FUNC 1174 * @tc.require: 1175 */ 1176 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubGetPointerColor_001, TestSize.Level1) 1177 { 1178 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1179 MessageParcel data; 1180 MessageParcel reply; 1181 std::atomic<ServiceRunningState> state_ = ServiceRunningState::STATE_NOT_START; 1182 int32_t ret = stub->StubGetPointerColor(data, reply); 1183 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 1184 state_ = ServiceRunningState::STATE_RUNNING; 1185 ret = stub->StubGetPointerColor(data, reply); 1186 EXPECT_NE(ret, RET_OK); 1187 } 1188 1189 /** 1190 * @tc.name: MultimodalInputConnectStubTest_StubSetPointerSpeed_001 1191 * @tc.desc: Test the function StubSetPointerSpeed 1192 * @tc.type: FUNC 1193 * @tc.require: 1194 */ 1195 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetPointerSpeed_001, TestSize.Level1) 1196 { 1197 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1198 MessageParcel data; 1199 MessageParcel reply; 1200 int32_t ret = stub->StubSetPointerSpeed(data, reply); 1201 EXPECT_NE(ret, RET_OK); 1202 } 1203 1204 /** 1205 * @tc.name: MultimodalInputConnectStubTest_StubGetPointerSpeed_001 1206 * @tc.desc: Test the function StubGetPointerSpeed 1207 * @tc.type: FUNC 1208 * @tc.require: 1209 */ 1210 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubGetPointerSpeed_001, TestSize.Level1) 1211 { 1212 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1213 MessageParcel data; 1214 MessageParcel reply; 1215 int32_t ret = stub->StubGetPointerSpeed(data, reply); 1216 EXPECT_EQ(ret, RET_ERR); 1217 } 1218 1219 /** 1220 * @tc.name: MultimodalInputConnectStubTest_StubNotifyNapOnline_001 1221 * @tc.desc: Test the function StubNotifyNapOnline 1222 * @tc.type: FUNC 1223 * @tc.require: 1224 */ 1225 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubNotifyNapOnline_001, TestSize.Level1) 1226 { 1227 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1228 MessageParcel data; 1229 MessageParcel reply; 1230 int32_t ret = stub->StubNotifyNapOnline(data, reply); 1231 EXPECT_EQ(ret, RET_OK); 1232 } 1233 1234 /** 1235 * @tc.name: MultimodalInputConnectStubTest_StubRemoveInputEventObserver_001 1236 * @tc.desc: Test the function StubRemoveInputEventObserver 1237 * @tc.type: FUNC 1238 * @tc.require: 1239 */ 1240 HWTEST_F(MultimodalInputConnectStubTest, StubRemoveInputEventObserver_001, TestSize.Level1) 1241 { 1242 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1243 MessageParcel data; 1244 MessageParcel reply; 1245 int32_t ret = stub->StubRemoveInputEventObserver(data, reply); 1246 EXPECT_EQ(ret, RET_OK); 1247 } 1248 1249 /** 1250 * @tc.name: MultimodalInputConnectStubTest_StubSetPointerStyle_001 1251 * @tc.desc: Test the function StubSetPointerStyle 1252 * @tc.type: FUNC 1253 * @tc.require: 1254 */ 1255 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetPointerStyle_001, TestSize.Level1) 1256 { 1257 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1258 MessageParcel data; 1259 MessageParcel reply; 1260 int32_t ret = stub->StubSetPointerStyle(data, reply); 1261 EXPECT_EQ(ret, RET_ERR); 1262 } 1263 1264 /** 1265 * @tc.name: MultimodalInputConnectStubTest_StubClearWindowPointerStyle_001 1266 * @tc.desc: Test the function StubClearWindowPointerStyle 1267 * @tc.type: FUNC 1268 * @tc.require: 1269 */ 1270 HWTEST_F(MultimodalInputConnectStubTest, StubClearWindowPointerStyle_001, TestSize.Level1) 1271 { 1272 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1273 MessageParcel data; 1274 MessageParcel reply; 1275 int32_t ret = stub->StubClearWindowPointerStyle(data, reply); 1276 EXPECT_EQ(ret, RET_ERR); 1277 } 1278 1279 /** 1280 * @tc.name: MultimodalInputConnectStubTest_StubGetPointerStyle_001 1281 * @tc.desc: Test the function StubGetPointerStyle 1282 * @tc.type: FUNC 1283 * @tc.require: 1284 */ 1285 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubGetPointerStyle_001, TestSize.Level1) 1286 { 1287 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1288 MessageParcel data; 1289 MessageParcel reply; 1290 int32_t ret = stub->StubGetPointerStyle(data, reply); 1291 EXPECT_EQ(ret, RET_ERR); 1292 } 1293 1294 /** 1295 * @tc.name: MultimodalInputConnectStubTest_StubSupportKeys_001 1296 * @tc.desc: Test the function StubSupportKeys 1297 * @tc.type: FUNC 1298 * @tc.require: 1299 */ 1300 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSupportKeys_001, TestSize.Level1) 1301 { 1302 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1303 MessageParcel data; 1304 MessageParcel reply; 1305 int32_t ret = stub->StubSupportKeys(data, reply); 1306 EXPECT_NE(ret, RET_OK); 1307 } 1308 /** 1309 * @tc.name: StubGetDevice_001 1310 * @tc.desc: Test the function StubGetDevice 1311 * @tc.type: FUNC 1312 * @tc.require: 1313 */ 1314 HWTEST_F(MultimodalInputConnectStubTest, StubGetDevice_001, TestSize.Level1) 1315 { 1316 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1317 MessageParcel data; 1318 MessageParcel reply; 1319 int32_t returnCode = 201; 1320 int32_t ret = stub->StubGetDevice(data, reply); 1321 EXPECT_EQ(ret, returnCode); 1322 } 1323 1324 /** 1325 * @tc.name: StubRegisterInputDeviceMonitor_001 1326 * @tc.desc: Test the function StubRegisterInputDeviceMonitor 1327 * @tc.type: FUNC 1328 * @tc.require: 1329 */ 1330 HWTEST_F(MultimodalInputConnectStubTest, StubRegisterInputDeviceMonitor_001, TestSize.Level1) 1331 { 1332 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1333 MessageParcel data; 1334 MessageParcel reply; 1335 int32_t returnCode = 65142804; 1336 int32_t ret = stub->StubRegisterInputDeviceMonitor(data, reply); 1337 EXPECT_EQ(ret, returnCode); 1338 } 1339 1340 /** 1341 * @tc.name: StubGetKeyboardType_001 1342 * @tc.desc: Test the function StubGetKeyboardType 1343 * @tc.type: FUNC 1344 * @tc.require: 1345 */ 1346 HWTEST_F(MultimodalInputConnectStubTest, StubGetKeyboardType_001, TestSize.Level1) 1347 { 1348 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1349 MessageParcel data; 1350 MessageParcel reply; 1351 int32_t returnCode = 201; 1352 int32_t ret = stub->StubGetKeyboardType(data, reply); 1353 EXPECT_EQ(ret, returnCode); 1354 } 1355 1356 /** 1357 * @tc.name: StubAddInputHandler_001 1358 * @tc.desc: Test the function StubAddInputHandler 1359 * @tc.type: FUNC 1360 * @tc.require: 1361 */ 1362 HWTEST_F(MultimodalInputConnectStubTest, StubAddInputHandler_001, TestSize.Level1) 1363 { 1364 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1365 MessageParcel data; 1366 MessageParcel reply; 1367 int32_t returnCode = 201; 1368 int32_t ret = stub->StubAddInputHandler(data, reply); 1369 EXPECT_EQ(ret, returnCode); 1370 } 1371 1372 /** 1373 * @tc.name: StubRemoveInputHandler_001 1374 * @tc.desc: Test the function StubRemoveInputHandler 1375 * @tc.type: FUNC 1376 * @tc.require: 1377 */ 1378 HWTEST_F(MultimodalInputConnectStubTest, StubRemoveInputHandler_001, TestSize.Level1) 1379 { 1380 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1381 MessageParcel data; 1382 MessageParcel reply; 1383 int32_t returnCode = 201; 1384 int32_t ret = stub->StubRemoveInputHandler(data, reply); 1385 EXPECT_EQ(ret, returnCode); 1386 } 1387 1388 /** 1389 * @tc.name: StubMarkEventConsumed_001 1390 * @tc.desc: Test the function StubMarkEventConsumed 1391 * @tc.type: FUNC 1392 * @tc.require: 1393 */ 1394 HWTEST_F(MultimodalInputConnectStubTest, StubMarkEventConsumed_001, TestSize.Level1) 1395 { 1396 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1397 MessageParcel data; 1398 MessageParcel reply; 1399 int32_t returnCode = 65142800; 1400 int32_t ret = stub->StubMarkEventConsumed(data, reply); 1401 EXPECT_EQ(ret, returnCode); 1402 } 1403 1404 /** 1405 * @tc.name: StubSubscribeKeyEvent_001 1406 * @tc.desc: Test the function StubSubscribeKeyEvent 1407 * @tc.type: FUNC 1408 * @tc.require: 1409 */ 1410 HWTEST_F(MultimodalInputConnectStubTest, StubSubscribeKeyEvent_001, TestSize.Level1) 1411 { 1412 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1413 MessageParcel data; 1414 MessageParcel reply; 1415 int32_t returnCode = 65142800; 1416 int32_t ret = stub->StubSubscribeKeyEvent(data, reply); 1417 EXPECT_EQ(ret, returnCode); 1418 } 1419 1420 /** 1421 * @tc.name: StubUnsubscribeKeyEvent_001 1422 * @tc.desc: Test the function StubUnsubscribeKeyEvent 1423 * @tc.type: FUNC 1424 * @tc.require: 1425 */ 1426 HWTEST_F(MultimodalInputConnectStubTest, StubUnsubscribeKeyEvent_001, TestSize.Level1) 1427 { 1428 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1429 MessageParcel data; 1430 MessageParcel reply; 1431 int32_t returnCode = 65142800; 1432 int32_t ret = stub->StubUnsubscribeKeyEvent(data, reply); 1433 EXPECT_EQ(ret, returnCode); 1434 } 1435 1436 /** 1437 * @tc.name: StubSubscribeSwitchEvent_001 1438 * @tc.desc: Test the function StubSubscribeSwitchEvent 1439 * @tc.type: FUNC 1440 * @tc.require: 1441 */ 1442 HWTEST_F(MultimodalInputConnectStubTest, StubSubscribeSwitchEvent_001, TestSize.Level1) 1443 { 1444 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1445 MessageParcel data; 1446 MessageParcel reply; 1447 int32_t returnCode = 65142800; 1448 int32_t ret = stub->StubSubscribeSwitchEvent(data, reply); 1449 EXPECT_EQ(ret, returnCode); 1450 } 1451 1452 /** 1453 * @tc.name: StubUnsubscribeSwitchEvent_001 1454 * @tc.desc: Test the function StubUnsubscribeSwitchEvent 1455 * @tc.type: FUNC 1456 * @tc.require: 1457 */ 1458 HWTEST_F(MultimodalInputConnectStubTest, StubUnsubscribeSwitchEvent_001, TestSize.Level1) 1459 { 1460 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1461 MessageParcel data; 1462 MessageParcel reply; 1463 int32_t returnCode = 65142800; 1464 int32_t ret = stub->StubUnsubscribeSwitchEvent(data, reply); 1465 EXPECT_EQ(ret, returnCode); 1466 } 1467 1468 /** 1469 * @tc.name: StubMoveMouseEvent_001 1470 * @tc.desc: Test the function StubMoveMouseEvent 1471 * @tc.type: FUNC 1472 * @tc.require: 1473 */ 1474 HWTEST_F(MultimodalInputConnectStubTest, StubMoveMouseEvent_001, TestSize.Level1) 1475 { 1476 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1477 MessageParcel data; 1478 MessageParcel reply; 1479 int32_t returnCode = 65142800; 1480 int32_t ret = stub->StubMoveMouseEvent(data, reply); 1481 EXPECT_EQ(ret, returnCode); 1482 } 1483 1484 /** 1485 * @tc.name: StubInjectKeyEvent_001 1486 * @tc.desc: Test the function StubInjectKeyEvent 1487 * @tc.type: FUNC 1488 * @tc.require: 1489 */ 1490 HWTEST_F(MultimodalInputConnectStubTest, StubInjectKeyEvent_001, TestSize.Level1) 1491 { 1492 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1493 MessageParcel data; 1494 MessageParcel reply; 1495 int32_t returnCode = 65142800; 1496 int32_t ret = stub->StubInjectKeyEvent(data, reply); 1497 EXPECT_EQ(ret, returnCode); 1498 } 1499 1500 /** 1501 * @tc.name: StubSetAnrListener_001 1502 * @tc.desc: Test the function StubSetAnrListener 1503 * @tc.type: FUNC 1504 * @tc.require: 1505 */ 1506 HWTEST_F(MultimodalInputConnectStubTest, StubSetAnrListener_001, TestSize.Level1) 1507 { 1508 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1509 MessageParcel data; 1510 MessageParcel reply; 1511 int32_t returnCode = 65142800; 1512 int32_t ret = stub->StubSetAnrListener(data, reply); 1513 EXPECT_EQ(ret, returnCode); 1514 } 1515 1516 /** 1517 * @tc.name: StubGetDisplayBindInfo_001 1518 * @tc.desc: Test the function StubGetDisplayBindInfo 1519 * @tc.type: FUNC 1520 * @tc.require: 1521 */ 1522 HWTEST_F(MultimodalInputConnectStubTest, StubGetDisplayBindInfo_001, TestSize.Level1) 1523 { 1524 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1525 MessageParcel data; 1526 MessageParcel reply; 1527 int32_t returnCode = 65142800; 1528 int32_t ret = stub->StubGetDisplayBindInfo(data, reply); 1529 EXPECT_EQ(ret, returnCode); 1530 } 1531 1532 /** 1533 * @tc.name: StubGetAllMmiSubscribedEvents_001 1534 * @tc.desc: Test the function StubGetAllMmiSubscribedEvents 1535 * @tc.type: FUNC 1536 * @tc.require: 1537 */ 1538 HWTEST_F(MultimodalInputConnectStubTest, StubGetAllMmiSubscribedEvents_001, TestSize.Level1) 1539 { 1540 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1541 MessageParcel data; 1542 MessageParcel reply; 1543 int32_t returnCode = 65142800; 1544 int32_t ret = stub->StubGetAllMmiSubscribedEvents(data, reply); 1545 EXPECT_EQ(ret, returnCode); 1546 } 1547 1548 /** 1549 * @tc.name: StubSetDisplayBind_001 1550 * @tc.desc: Test the function StubSetDisplayBind 1551 * @tc.type: FUNC 1552 * @tc.require: 1553 */ 1554 HWTEST_F(MultimodalInputConnectStubTest, StubSetDisplayBind_001, TestSize.Level1) 1555 { 1556 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1557 MessageParcel data; 1558 MessageParcel reply; 1559 int32_t returnCode = 65142800; 1560 int32_t ret = stub->StubSetDisplayBind(data, reply); 1561 EXPECT_EQ(ret, returnCode); 1562 } 1563 1564 /** 1565 * @tc.name: StubGetFunctionKeyState_001 1566 * @tc.desc: Test the function StubGetFunctionKeyState 1567 * @tc.type: FUNC 1568 * @tc.require: 1569 */ 1570 HWTEST_F(MultimodalInputConnectStubTest, StubGetFunctionKeyState_001, TestSize.Level1) 1571 { 1572 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1573 MessageParcel data; 1574 MessageParcel reply; 1575 int32_t returnCode = 65142800; 1576 int32_t ret = stub->StubGetFunctionKeyState(data, reply); 1577 EXPECT_EQ(ret, returnCode); 1578 } 1579 1580 /** 1581 * @tc.name: StubSetFunctionKeyState_001 1582 * @tc.desc: Test the function StubSetFunctionKeyState 1583 * @tc.type: FUNC 1584 * @tc.require: 1585 */ 1586 HWTEST_F(MultimodalInputConnectStubTest, StubSetFunctionKeyState_001, TestSize.Level1) 1587 { 1588 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1589 MessageParcel data; 1590 MessageParcel reply; 1591 int32_t returnCode = 65142800; 1592 int32_t ret = stub->StubSetFunctionKeyState(data, reply); 1593 EXPECT_EQ(ret, returnCode); 1594 } 1595 1596 /** 1597 * @tc.name: StubSetPointerLocation_001 1598 * @tc.desc: Test the function StubSetPointerLocation 1599 * @tc.type: FUNC 1600 * @tc.require: 1601 */ 1602 HWTEST_F(MultimodalInputConnectStubTest, StubSetPointerLocation_001, TestSize.Level1) 1603 { 1604 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1605 MessageParcel data; 1606 MessageParcel reply; 1607 int32_t returnCode = 65142800; 1608 int32_t ret = stub->StubSetPointerLocation(data, reply); 1609 EXPECT_EQ(ret, returnCode); 1610 } 1611 1612 /** 1613 * @tc.name: StubSetMouseCaptureMode_001 1614 * @tc.desc: Test the function StubSetMouseCaptureMode 1615 * @tc.type: FUNC 1616 * @tc.require: 1617 */ 1618 HWTEST_F(MultimodalInputConnectStubTest, StubSetMouseCaptureMode_001, TestSize.Level1) 1619 { 1620 std::shared_ptr<MultimodalInputConnectStub> stub = std::make_shared<MMIService>(); 1621 MessageParcel data; 1622 MessageParcel reply; 1623 int32_t returnCode = 201; 1624 int32_t ret = stub->StubSetMouseCaptureMode(data, reply); 1625 EXPECT_EQ(ret, returnCode); 1626 } 1627 1628 /** 1629 * @tc.name: MultimodalInputConnectStubTest_StubGetWindowPid_001 1630 * @tc.desc: Test the function StubGetWindowPid 1631 * @tc.type: FUNC 1632 * @tc.require: 1633 */ 1634 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubGetWindowPid_001, TestSize.Level1) 1635 { 1636 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1637 MessageParcel data; 1638 MessageParcel reply; 1639 std::atomic<ServiceRunningState> state = ServiceRunningState::STATE_NOT_START; 1640 int32_t ret = stub->StubGetWindowPid(data, reply); 1641 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 1642 state = ServiceRunningState::STATE_RUNNING; 1643 ret = stub->StubGetWindowPid(data, reply); 1644 EXPECT_NE(ret, RET_OK); 1645 } 1646 1647 /** 1648 * @tc.name: MultimodalInputConnectStubTest_StubAppendExtraData_001 1649 * @tc.desc: Test the function StubAppendExtraData 1650 * @tc.type: FUNC 1651 * @tc.require: 1652 */ 1653 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubAppendExtraData_001, TestSize.Level1) 1654 { 1655 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1656 MessageParcel data; 1657 MessageParcel reply; 1658 std::atomic<ServiceRunningState> state = ServiceRunningState::STATE_NOT_START; 1659 int32_t ret = stub->StubAppendExtraData(data, reply); 1660 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 1661 state = ServiceRunningState::STATE_RUNNING; 1662 ret = stub->StubAppendExtraData(data, reply); 1663 EXPECT_NE(ret, RET_OK); 1664 } 1665 1666 /** 1667 * @tc.name: MultimodalInputConnectStubTest_StubEnableCombineKey_001 1668 * @tc.desc: Test the function StubEnableCombineKey 1669 * @tc.type: FUNC 1670 * @tc.require: 1671 */ 1672 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubEnableCombineKey_001, TestSize.Level1) 1673 { 1674 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1675 MessageParcel data; 1676 MessageParcel reply; 1677 std::atomic<ServiceRunningState> state = ServiceRunningState::STATE_NOT_START; 1678 int32_t ret = stub->StubEnableCombineKey(data, reply); 1679 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 1680 state = ServiceRunningState::STATE_RUNNING; 1681 ret = stub->StubEnableCombineKey(data, reply); 1682 EXPECT_NE(ret, RET_OK); 1683 } 1684 1685 /** 1686 * @tc.name: MultimodalInputConnectStubTest_StubEnableInputDevice_001 1687 * @tc.desc: Test the function StubEnableInputDevice 1688 * @tc.type: FUNC 1689 * @tc.require: 1690 */ 1691 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubEnableInputDevice_001, TestSize.Level1) 1692 { 1693 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1694 MessageParcel data; 1695 MessageParcel reply; 1696 EXPECT_NO_FATAL_FAILURE(stub->StubEnableInputDevice(data, reply)); 1697 } 1698 1699 /** 1700 * @tc.name: MultimodalInputConnectStubTest_StubSetKeyDownDuration_001 1701 * @tc.desc: Test the function StubSetKeyDownDuration 1702 * @tc.type: FUNC 1703 * @tc.require: 1704 */ 1705 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetKeyDownDuration_001, TestSize.Level1) 1706 { 1707 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1708 MessageParcel data; 1709 MessageParcel reply; 1710 std::atomic<ServiceRunningState> state = ServiceRunningState::STATE_NOT_START; 1711 int32_t ret = stub->StubSetKeyDownDuration(data, reply); 1712 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 1713 state = ServiceRunningState::STATE_RUNNING; 1714 ret = stub->StubSetKeyDownDuration(data, reply); 1715 EXPECT_NE(ret, RET_OK); 1716 } 1717 1718 /** 1719 * @tc.name: MultimodalInputConnectStubTest_VerifyTouchPadSetting_001 1720 * @tc.desc: Test the function VerifyTouchPadSetting 1721 * @tc.type: FUNC 1722 * @tc.require: 1723 */ 1724 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_VerifyTouchPadSetting_001, TestSize.Level1) 1725 { 1726 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1727 std::atomic<ServiceRunningState> state = ServiceRunningState::STATE_NOT_START; 1728 int32_t ret = stub->VerifyTouchPadSetting(); 1729 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 1730 state = ServiceRunningState::STATE_RUNNING; 1731 ret = stub->VerifyTouchPadSetting(); 1732 EXPECT_NE(ret, RET_OK); 1733 } 1734 1735 /** 1736 * @tc.name: MultimodalInputConnectStubTest_StubSetTouchpadScrollSwitch_001 1737 * @tc.desc: Test the function StubSetTouchpadScrollSwitch 1738 * @tc.type: FUNC 1739 * @tc.require: 1740 */ 1741 HWTEST_F(MultimodalInputConnectStubTest, StubSetTouchpadScrollSwitch_001, TestSize.Level1) 1742 { 1743 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1744 MessageParcel data; 1745 MessageParcel reply; 1746 int32_t ret = stub->StubSetTouchpadScrollSwitch(data, reply); 1747 EXPECT_NE(ret, RET_OK); 1748 } 1749 1750 /** 1751 * @tc.name: MultimodalInputConnectStubTest_StubGetTouchpadScrollSwitch_001 1752 * @tc.desc: Test the function StubGetTouchpadScrollSwitch 1753 * @tc.type: FUNC 1754 * @tc.require: 1755 */ 1756 HWTEST_F(MultimodalInputConnectStubTest, StubGetTouchpadScrollSwitch_001, TestSize.Level1) 1757 { 1758 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1759 MessageParcel data; 1760 MessageParcel reply; 1761 int32_t ret = stub->StubGetTouchpadScrollSwitch(data, reply); 1762 EXPECT_NE(ret, RET_OK); 1763 } 1764 1765 /** 1766 * @tc.name: MultimodalInputConnectStubTest_StubSetTouchpadScrollDirection_001 1767 * @tc.desc: Test the function StubSetTouchpadScrollDirection 1768 * @tc.type: FUNC 1769 * @tc.require: 1770 */ 1771 HWTEST_F(MultimodalInputConnectStubTest, StubSetTouchpadScrollDirection_001, TestSize.Level1) 1772 { 1773 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1774 MessageParcel data; 1775 MessageParcel reply; 1776 int32_t ret = stub->StubSetTouchpadScrollDirection(data, reply); 1777 EXPECT_NE(ret, RET_OK); 1778 } 1779 1780 /** 1781 * @tc.name: MultimodalInputConnectStubTest_StubGetTouchpadScrollDirection_001 1782 * @tc.desc: Test the function StubGetTouchpadScrollDirection 1783 * @tc.type: FUNC 1784 * @tc.require: 1785 */ 1786 HWTEST_F(MultimodalInputConnectStubTest, StubGetTouchpadScrollDirection_001, TestSize.Level1) 1787 { 1788 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1789 MessageParcel data; 1790 MessageParcel reply; 1791 int32_t ret = stub->StubGetTouchpadScrollDirection(data, reply); 1792 EXPECT_NE(ret, RET_OK); 1793 } 1794 1795 /** 1796 * @tc.name: MultimodalInputConnectStubTest_StubSetTouchpadTapSwitch_001 1797 * @tc.desc: Test the function StubSetTouchpadTapSwitch 1798 * @tc.type: FUNC 1799 * @tc.require: 1800 */ 1801 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetTouchpadTapSwitch_001, TestSize.Level1) 1802 { 1803 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1804 MessageParcel data; 1805 MessageParcel reply; 1806 int32_t ret = stub->StubSetTouchpadTapSwitch(data, reply); 1807 EXPECT_NE(ret, RET_OK); 1808 } 1809 1810 /** 1811 * @tc.name: MultimodalInputConnectStubTest_StubGetTouchpadTapSwitch_001 1812 * @tc.desc: Test the function StubGetTouchpadTapSwitch 1813 * @tc.type: FUNC 1814 * @tc.require: 1815 */ 1816 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubGetTouchpadTapSwitch_001, TestSize.Level1) 1817 { 1818 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1819 MessageParcel data; 1820 MessageParcel reply; 1821 int32_t ret = stub->StubGetTouchpadTapSwitch(data, reply); 1822 EXPECT_NE(ret, RET_OK); 1823 } 1824 1825 /** 1826 * @tc.name: MultimodalInputConnectStubTest_StubSetTouchpadPointerSpeed_001 1827 * @tc.desc: Test the function StubSetTouchpadPointerSpeed 1828 * @tc.type: FUNC 1829 * @tc.require: 1830 */ 1831 HWTEST_F(MultimodalInputConnectStubTest, StubSetTouchpadPointerSpeed_001, TestSize.Level1) 1832 { 1833 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1834 MessageParcel data; 1835 MessageParcel reply; 1836 int32_t ret = stub->StubSetTouchpadPointerSpeed(data, reply); 1837 EXPECT_NE(ret, RET_OK); 1838 } 1839 1840 /** 1841 * @tc.name: MultimodalInputConnectStubTest_StubGetTouchpadPointerSpeed_001 1842 * @tc.desc: Test the function StubGetTouchpadPointerSpeed 1843 * @tc.type: FUNC 1844 * @tc.require: 1845 */ 1846 HWTEST_F(MultimodalInputConnectStubTest, StubGetTouchpadPointerSpeed_001, TestSize.Level1) 1847 { 1848 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1849 MessageParcel data; 1850 MessageParcel reply; 1851 int32_t ret = stub->StubGetTouchpadPointerSpeed(data, reply); 1852 EXPECT_NE(ret, RET_OK); 1853 } 1854 1855 /** 1856 * @tc.name: MultimodalInputConnectStubTest_StubSetKeyboardRepeatDelay_001 1857 * @tc.desc: Test the function StubSetKeyboardRepeatDelay 1858 * @tc.type: FUNC 1859 * @tc.require: 1860 */ 1861 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetKeyboardRepeatDelay_001, TestSize.Level1) 1862 { 1863 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1864 MessageParcel data; 1865 MessageParcel reply; 1866 std::atomic<ServiceRunningState> state = ServiceRunningState::STATE_NOT_START; 1867 int32_t ret = stub->StubSetKeyboardRepeatDelay(data, reply); 1868 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 1869 state = ServiceRunningState::STATE_RUNNING; 1870 ret = stub->StubSetKeyboardRepeatDelay(data, reply); 1871 EXPECT_NE(ret, RET_OK); 1872 } 1873 1874 /** 1875 * @tc.name: MultimodalInputConnectStubTest_StubSetKeyboardRepeatRate_001 1876 * @tc.desc: Test the function StubSetKeyboardRepeatRate 1877 * @tc.type: FUNC 1878 * @tc.require: 1879 */ 1880 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetKeyboardRepeatRate_001, TestSize.Level1) 1881 { 1882 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1883 MessageParcel data; 1884 MessageParcel reply; 1885 std::atomic<ServiceRunningState> state = ServiceRunningState::STATE_NOT_START; 1886 int32_t ret = stub->StubSetKeyboardRepeatRate(data, reply); 1887 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 1888 state = ServiceRunningState::STATE_RUNNING; 1889 ret = stub->StubSetKeyboardRepeatRate(data, reply); 1890 EXPECT_NE(ret, RET_OK); 1891 } 1892 1893 /** 1894 * @tc.name: MultimodalInputConnectStubTest_StubGetKeyboardRepeatDelay_001 1895 * @tc.desc: Test the function StubGetKeyboardRepeatDelay 1896 * @tc.type: FUNC 1897 * @tc.require: 1898 */ 1899 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubGetKeyboardRepeatDelay_001, TestSize.Level1) 1900 { 1901 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1902 MessageParcel data; 1903 MessageParcel reply; 1904 std::atomic<ServiceRunningState> state = ServiceRunningState::STATE_NOT_START; 1905 int32_t ret = stub->StubGetKeyboardRepeatDelay(data, reply); 1906 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 1907 state = ServiceRunningState::STATE_RUNNING; 1908 ret = stub->StubGetKeyboardRepeatDelay(data, reply); 1909 EXPECT_NE(ret, RET_OK); 1910 } 1911 1912 /** 1913 * @tc.name: MultimodalInputConnectStubTest_StubGetKeyboardRepeatRate_001 1914 * @tc.desc: Test the function StubGetKeyboardRepeatRate 1915 * @tc.type: FUNC 1916 * @tc.require: 1917 */ 1918 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubGetKeyboardRepeatRate_001, TestSize.Level1) 1919 { 1920 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1921 MessageParcel data; 1922 MessageParcel reply; 1923 std::atomic<ServiceRunningState> state = ServiceRunningState::STATE_NOT_START; 1924 int32_t ret = stub->StubGetKeyboardRepeatRate(data, reply); 1925 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 1926 state = ServiceRunningState::STATE_RUNNING; 1927 ret = stub->StubGetKeyboardRepeatRate(data, reply); 1928 EXPECT_NE(ret, RET_OK); 1929 } 1930 1931 /** 1932 * @tc.name: MultimodalInputConnectStubTest_StubSetTouchpadPinchSwitch_001 1933 * @tc.desc: Test the function StubSetTouchpadPinchSwitch 1934 * @tc.type: FUNC 1935 * @tc.require: 1936 */ 1937 HWTEST_F(MultimodalInputConnectStubTest, StubSetTouchpadPinchSwitch_001, TestSize.Level1) 1938 { 1939 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1940 MessageParcel data; 1941 MessageParcel reply; 1942 int32_t ret = stub->StubSetTouchpadPinchSwitch(data, reply); 1943 EXPECT_NE(ret, RET_OK); 1944 } 1945 1946 /** 1947 * @tc.name: MultimodalInputConnectStubTest_StubGetTouchpadPinchSwitch_001 1948 * @tc.desc: Test the function StubGetTouchpadPinchSwitch 1949 * @tc.type: FUNC 1950 * @tc.require: 1951 */ 1952 HWTEST_F(MultimodalInputConnectStubTest, StubGetTouchpadPinchSwitch_001, TestSize.Level1) 1953 { 1954 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1955 MessageParcel data; 1956 MessageParcel reply; 1957 int32_t ret = stub->StubGetTouchpadPinchSwitch(data, reply); 1958 EXPECT_NE(ret, RET_OK); 1959 } 1960 1961 /** 1962 * @tc.name: MultimodalInputConnectStubTest_StubSetTouchpadSwipeSwitch_001 1963 * @tc.desc: Test the function StubSetTouchpadSwipeSwitch 1964 * @tc.type: FUNC 1965 * @tc.require: 1966 */ 1967 HWTEST_F(MultimodalInputConnectStubTest, StubSetTouchpadSwipeSwitch_001, TestSize.Level1) 1968 { 1969 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1970 MessageParcel data; 1971 MessageParcel reply; 1972 int32_t ret = stub->StubSetTouchpadSwipeSwitch(data, reply); 1973 EXPECT_NE(ret, RET_OK); 1974 } 1975 1976 /** 1977 * @tc.name: MultimodalInputConnectStubTest_StubGetTouchpadSwipeSwitch_001 1978 * @tc.desc: Test the function StubGetTouchpadSwipeSwitch 1979 * @tc.type: FUNC 1980 * @tc.require: 1981 */ 1982 HWTEST_F(MultimodalInputConnectStubTest, StubGetTouchpadSwipeSwitch_001, TestSize.Level1) 1983 { 1984 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 1985 MessageParcel data; 1986 MessageParcel reply; 1987 int32_t ret = stub->StubGetTouchpadSwipeSwitch(data, reply); 1988 EXPECT_NE(ret, RET_OK); 1989 } 1990 1991 /** 1992 * @tc.name: MultimodalInputConnectStubTest_StubSetTouchpadRightClickType_001 1993 * @tc.desc: Test the function StubSetTouchpadRightClickType 1994 * @tc.type: FUNC 1995 * @tc.require: 1996 */ 1997 HWTEST_F(MultimodalInputConnectStubTest, StubSetTouchpadRightClickType_001, TestSize.Level1) 1998 { 1999 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2000 MessageParcel data; 2001 MessageParcel reply; 2002 int32_t ret = stub->StubSetTouchpadRightClickType(data, reply); 2003 EXPECT_NE(ret, RET_OK); 2004 } 2005 2006 /** 2007 * @tc.name: MultimodalInputConnectStubTest_StubGetTouchpadRightClickType_001 2008 * @tc.desc: Test the function StubGetTouchpadRightClickType 2009 * @tc.type: FUNC 2010 * @tc.require: 2011 */ 2012 HWTEST_F(MultimodalInputConnectStubTest, StubGetTouchpadRightClickType_001, TestSize.Level1) 2013 { 2014 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2015 MessageParcel data; 2016 MessageParcel reply; 2017 int32_t ret = stub->StubGetTouchpadRightClickType(data, reply); 2018 EXPECT_NE(ret, RET_OK); 2019 } 2020 2021 /** 2022 * @tc.name: MultimodalInputConnectStubTest_StubSetShieldStatus_001 2023 * @tc.desc: Test the function StubSetShieldStatus 2024 * @tc.type: FUNC 2025 * @tc.require: 2026 */ 2027 HWTEST_F(MultimodalInputConnectStubTest, StubSetShieldStatus_001, TestSize.Level1) 2028 { 2029 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2030 MessageParcel data; 2031 MessageParcel reply; 2032 int32_t ret = stub->StubSetShieldStatus(data, reply); 2033 EXPECT_NE(ret, RET_OK); 2034 } 2035 2036 /** 2037 * @tc.name: MultimodalInputConnectStubTest_StubSetShieldStatus_001 2038 * @tc.desc: Test the function StubSetShieldStatus 2039 * @tc.type: FUNC 2040 * @tc.require: 2041 */ 2042 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetShieldStatus_001, TestSize.Level1) 2043 { 2044 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2045 MessageParcel data; 2046 MessageParcel reply; 2047 std::atomic<ServiceRunningState> state = ServiceRunningState::STATE_NOT_START; 2048 int32_t ret = stub->StubSetShieldStatus(data, reply); 2049 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 2050 state = ServiceRunningState::STATE_RUNNING; 2051 ret = stub->StubSetShieldStatus(data, reply); 2052 EXPECT_NE(ret, RET_OK); 2053 } 2054 2055 /** 2056 * @tc.name: MultimodalInputConnectStubTest_StubGetShieldStatus_001 2057 * @tc.desc: Test the function StubGetShieldStatus 2058 * @tc.type: FUNC 2059 * @tc.require: 2060 */ 2061 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubGetShieldStatus_001, TestSize.Level1) 2062 { 2063 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2064 MessageParcel data; 2065 MessageParcel reply; 2066 std::atomic<ServiceRunningState> state = ServiceRunningState::STATE_NOT_START; 2067 int32_t ret = stub->StubGetShieldStatus(data, reply); 2068 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 2069 state = ServiceRunningState::STATE_RUNNING; 2070 ret = stub->StubGetShieldStatus(data, reply); 2071 EXPECT_NE(ret, RET_OK); 2072 } 2073 2074 /** 2075 * @tc.name: MultimodalInputConnectStubTest_StubGetKeyState_001 2076 * @tc.desc: Test the function StubGetKeyState 2077 * @tc.type: FUNC 2078 * @tc.require: 2079 */ 2080 HWTEST_F(MultimodalInputConnectStubTest, StubGetKeyState_001, TestSize.Level1) 2081 { 2082 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2083 MessageParcel data; 2084 MessageParcel reply; 2085 int32_t ret = stub->StubGetKeyState(data, reply); 2086 EXPECT_EQ(ret, RET_ERR); 2087 } 2088 2089 /** 2090 * @tc.name: MultimodalInputConnectStubTest_StubAuthorize_001 2091 * @tc.desc: Test the function StubAuthorize 2092 * @tc.type: FUNC 2093 * @tc.require: 2094 */ 2095 HWTEST_F(MultimodalInputConnectStubTest, StubAuthorize_001, TestSize.Level1) 2096 { 2097 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2098 MessageParcel data; 2099 MessageParcel reply; 2100 int32_t ret = stub->StubAuthorize(data, reply); 2101 EXPECT_NE(ret, RET_OK); 2102 } 2103 2104 /** 2105 * @tc.name: MultimodalInputConnectStubTest_StubCancelInjection_001 2106 * @tc.desc: Test the function StubCancelInjection 2107 * @tc.type: FUNC 2108 * @tc.require: 2109 */ 2110 HWTEST_F(MultimodalInputConnectStubTest, StubCancelInjection_001, TestSize.Level1) 2111 { 2112 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2113 MessageParcel data; 2114 MessageParcel reply; 2115 int32_t ret = stub->StubCancelInjection(data, reply); 2116 EXPECT_NE(ret, RET_OK); 2117 } 2118 2119 /** 2120 * @tc.name: MultimodalInputConnectStubTest_StubSetPixelMapData_001 2121 * @tc.desc: Test the function StubSetPixelMapData 2122 * @tc.type: FUNC 2123 * @tc.require: 2124 */ 2125 HWTEST_F(MultimodalInputConnectStubTest, MultimodalInputConnectStubTest_StubSetPixelMapData_001, TestSize.Level1) 2126 { 2127 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2128 MessageParcel data; 2129 MessageParcel reply; 2130 std::atomic<ServiceRunningState> state = ServiceRunningState::STATE_NOT_START; 2131 int32_t ret = stub->StubSetPixelMapData(data, reply); 2132 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 2133 state = ServiceRunningState::STATE_RUNNING; 2134 ret = stub->StubSetPixelMapData(data, reply); 2135 EXPECT_NE(ret, RET_OK); 2136 } 2137 2138 /** 2139 * @tc.name: StubHandleAllocSocketFd_002 2140 * @tc.desc: Test the function StubHandleAllocSocketFd 2141 * @tc.type: FUNC 2142 * @tc.require: 2143 */ 2144 HWTEST_F(MultimodalInputConnectStubTest, StubHandleAllocSocketFd_002, TestSize.Level1) 2145 { 2146 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2147 MessageParcel data; 2148 MessageParcel reply; 2149 std::atomic<ServiceRunningState> state_ = ServiceRunningState::STATE_NOT_START; 2150 int32_t ret = stub->StubHandleAllocSocketFd(data, reply); 2151 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 2152 state_ = ServiceRunningState::STATE_RUNNING; 2153 ret = stub->StubHandleAllocSocketFd(data, reply); 2154 EXPECT_NE(ret, RET_OK); 2155 } 2156 2157 /** 2158 * @tc.name: StubSetMouseScrollRows_002 2159 * @tc.desc: Test the function StubSetMouseScrollRows 2160 * @tc.type: FUNC 2161 * @tc.require: 2162 */ 2163 HWTEST_F(MultimodalInputConnectStubTest, StubSetMouseScrollRows_002, TestSize.Level1) 2164 { 2165 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2166 MessageParcel data; 2167 MessageParcel reply; 2168 std::atomic<ServiceRunningState> state_ = ServiceRunningState::STATE_NOT_START; 2169 int32_t ret = stub->StubSetMouseScrollRows(data, reply); 2170 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 2171 state_ = ServiceRunningState::STATE_RUNNING; 2172 ret = stub->StubSetMouseScrollRows(data, reply); 2173 EXPECT_NE(ret, RET_OK); 2174 } 2175 2176 /** 2177 * @tc.name: StubSetCustomCursor_002 2178 * @tc.desc: Test the function StubSetCustomCursor 2179 * @tc.type: FUNC 2180 * @tc.require: 2181 */ 2182 HWTEST_F(MultimodalInputConnectStubTest, StubSetCustomCursor_002, TestSize.Level1) 2183 { 2184 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2185 MessageParcel data; 2186 MessageParcel reply; 2187 std::atomic<ServiceRunningState> state_ = ServiceRunningState::STATE_NOT_START; 2188 int32_t ret = stub->StubSetCustomCursor(data, reply); 2189 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 2190 state_ = ServiceRunningState::STATE_RUNNING; 2191 ret = stub->StubSetCustomCursor(data, reply); 2192 EXPECT_NE(ret, RET_OK); 2193 } 2194 2195 /** 2196 * @tc.name: StubSetMouseIcon_002 2197 * @tc.desc: Test the function StubSetMouseIcon 2198 * @tc.type: FUNC 2199 * @tc.require: 2200 */ 2201 HWTEST_F(MultimodalInputConnectStubTest, StubSetMouseIcon_002, TestSize.Level1) 2202 { 2203 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2204 MessageParcel data; 2205 MessageParcel reply; 2206 std::atomic<ServiceRunningState> state_ = ServiceRunningState::STATE_NOT_START; 2207 int32_t ret = stub->StubSetMouseIcon(data, reply); 2208 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 2209 state_ = ServiceRunningState::STATE_RUNNING; 2210 ret = stub->StubSetMouseIcon(data, reply); 2211 EXPECT_NE(ret, RET_OK); 2212 } 2213 2214 /** 2215 * @tc.name: StubSetMouseHotSpot_002 2216 * @tc.desc: Test the function StubSetMouseHotSpot 2217 * @tc.type: FUNC 2218 * @tc.require: 2219 */ 2220 HWTEST_F(MultimodalInputConnectStubTest, StubSetMouseHotSpot_002, TestSize.Level1) 2221 { 2222 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2223 MessageParcel data; 2224 MessageParcel reply; 2225 std::atomic<ServiceRunningState> state_ = ServiceRunningState::STATE_NOT_START; 2226 int32_t ret = stub->StubSetMouseHotSpot(data, reply); 2227 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 2228 state_ = ServiceRunningState::STATE_RUNNING; 2229 ret = stub->StubSetMouseHotSpot(data, reply); 2230 EXPECT_NE(ret, RET_OK); 2231 } 2232 2233 /** 2234 * @tc.name: StubGetMouseScrollRows_002 2235 * @tc.desc: Test the function StubGetMouseScrollRows 2236 * @tc.type: FUNC 2237 * @tc.require: 2238 */ 2239 HWTEST_F(MultimodalInputConnectStubTest, StubGetMouseScrollRows_002, TestSize.Level1) 2240 { 2241 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2242 MessageParcel data; 2243 MessageParcel reply; 2244 std::atomic<ServiceRunningState> state_ = ServiceRunningState::STATE_NOT_START; 2245 int32_t ret = stub->StubGetMouseScrollRows(data, reply); 2246 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 2247 state_ = ServiceRunningState::STATE_RUNNING; 2248 ret = stub->StubGetMouseScrollRows(data, reply); 2249 EXPECT_NE(ret, RET_OK); 2250 } 2251 2252 /** 2253 * @tc.name: StubSetPointerSize_002 2254 * @tc.desc: Test the function StubSetPointerSize 2255 * @tc.type: FUNC 2256 * @tc.require: 2257 */ 2258 HWTEST_F(MultimodalInputConnectStubTest, StubSetPointerSize_002, TestSize.Level1) 2259 { 2260 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2261 MessageParcel data; 2262 MessageParcel reply; 2263 std::atomic<ServiceRunningState> state_ = ServiceRunningState::STATE_NOT_START; 2264 int32_t ret = stub->StubSetPointerSize(data, reply); 2265 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 2266 state_ = ServiceRunningState::STATE_RUNNING; 2267 ret = stub->StubSetPointerSize(data, reply); 2268 EXPECT_NE(ret, RET_OK); 2269 } 2270 2271 /** 2272 * @tc.name: StubSetNapStatus_002 2273 * @tc.desc: Test the function StubSetNapStatus 2274 * @tc.type: FUNC 2275 * @tc.require: 2276 */ 2277 HWTEST_F(MultimodalInputConnectStubTest, StubSetNapStatus_002, TestSize.Level1) 2278 { 2279 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2280 MessageParcel data; 2281 MessageParcel reply; 2282 std::atomic<ServiceRunningState> state_ = ServiceRunningState::STATE_NOT_START; 2283 int32_t ret = stub->StubSetNapStatus(data, reply); 2284 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 2285 state_ = ServiceRunningState::STATE_RUNNING; 2286 ret = stub->StubSetNapStatus(data, reply); 2287 EXPECT_NE(ret, RET_OK); 2288 } 2289 2290 /** 2291 * @tc.name: StubInjectKeyEvent_002 2292 * @tc.desc: Test the function StubInjectKeyEvent 2293 * @tc.type: FUNC 2294 * @tc.require: 2295 */ 2296 HWTEST_F(MultimodalInputConnectStubTest, StubInjectKeyEvent_002, TestSize.Level1) 2297 { 2298 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2299 MessageParcel data; 2300 MessageParcel reply; 2301 std::atomic<ServiceRunningState> state_ = ServiceRunningState::STATE_NOT_START; 2302 int32_t ret = stub->StubInjectKeyEvent(data, reply); 2303 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 2304 state_ = ServiceRunningState::STATE_RUNNING; 2305 ret = stub->StubInjectKeyEvent(data, reply); 2306 EXPECT_NE(ret, RET_OK); 2307 } 2308 2309 /** 2310 * @tc.name: StubInjectPointerEvent_001 2311 * @tc.desc: Test the function StubInjectPointerEvent 2312 * @tc.type: FUNC 2313 * @tc.require: 2314 */ 2315 HWTEST_F(MultimodalInputConnectStubTest, StubInjectPointerEvent_001, TestSize.Level1) 2316 { 2317 std::shared_ptr<MultimodalInputConnectStub>stub = std::make_shared<MMIService>(); 2318 MessageParcel data; 2319 MessageParcel reply; 2320 std::atomic<ServiceRunningState> state_ = ServiceRunningState::STATE_NOT_START; 2321 int32_t ret = stub->StubInjectPointerEvent(data, reply); 2322 EXPECT_EQ(ret, MMISERVICE_NOT_RUNNING); 2323 state_ = ServiceRunningState::STATE_RUNNING; 2324 ret = stub->StubInjectPointerEvent(data, reply); 2325 EXPECT_NE(ret, RET_OK); 2326 } 2327 } // namespace MMI 2328 } // namespace OHOS