@@ -497,30 +497,22 @@ class HdmiCecSourceInitializedEventTest : public HdmiCecSourceInitializedTest {
497
497
498
498
TEST_F (HdmiCecSourceInitializedTest, setEnabled_EnablesCecSuccessfully)
499
499
{
500
- // Setup mocks for CEC enable operation
501
- EXPECT_CALL (*p_wrapsImplMock, persistJsonSettings (::testing::_, ::testing::_))
502
- .Times (1 )
503
- .WillOnce (::testing::Return (true ));
504
-
505
- EXPECT_CALL (*p_libCCECImplMock, getInstance ())
506
- .Times (::testing::AtLeast (1 ))
507
- .WillRepeatedly (::testing::Return (p_libCCECImplMock));
508
-
509
- EXPECT_CALL (*p_connectionImplMock, open ())
510
- .Times (1 )
511
- .WillOnce (::testing::Return (true ));
512
-
500
+ // Setup mocks for device settings initialization
513
501
EXPECT_CALL (*p_managerImplMock, Initialize ())
514
- .Times (1 )
515
- .WillOnce (::testing::Return ());
502
+ .Times (1 );
516
503
517
- EXPECT_CALL (*p_hostImplMock, getVideoOutputPort ())
504
+ EXPECT_CALL (*p_hostImplMock, getVideoOutputPort (::testing::_ ))
518
505
.Times (::testing::AtLeast (1 ))
519
- .WillRepeatedly (::testing::Return ( p_videoOutputPortMock));
506
+ .WillRepeatedly (::testing::ReturnRef (* p_videoOutputPortMock));
520
507
521
508
EXPECT_CALL (*p_videoOutputPortMock, getDisplay ())
522
509
.Times (::testing::AtLeast (1 ))
523
- .WillRepeatedly (::testing::Return (p_displayMock));
510
+ .WillRepeatedly (::testing::ReturnRef (*p_displayMock));
511
+
512
+ // Setup IARM bus mock expectations
513
+ EXPECT_CALL (*p_iarmBusImplMock, IARM_Bus_RegisterEventHandler (::testing::_, ::testing::_, ::testing::_))
514
+ .Times (::testing::AtLeast (1 ))
515
+ .WillRepeatedly (::testing::Return (IARM_RESULT_SUCCESS));
524
516
525
517
// Test setEnabled with enabled=true
526
518
string response;
@@ -529,7 +521,7 @@ TEST_F(HdmiCecSourceInitializedTest, setEnabled_EnablesCecSuccessfully)
529
521
// Verify successful response
530
522
EXPECT_EQ (response, string (" {\" success\" :true}" ));
531
523
532
- // Verify that CEC was actually enabled by checking the status
524
+ // Verify that the enable state can be retrieved
533
525
string getEnabledResponse;
534
526
EXPECT_EQ (Core::ERROR_NONE, handler.Invoke (connection, _T (" getEnabled" ), _T (" {}" ), getEnabledResponse));
535
527
EXPECT_THAT (getEnabledResponse, ::testing::HasSubstr (" \" enabled\" :true" ));
0 commit comments