diff options
-rw-r--r-- | src/components/media_manager/test/media_manager_impl_test.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/components/media_manager/test/media_manager_impl_test.cc b/src/components/media_manager/test/media_manager_impl_test.cc index a9dc27d7a3..c2a1c74b5d 100644 --- a/src/components/media_manager/test/media_manager_impl_test.cc +++ b/src/components/media_manager/test/media_manager_impl_test.cc @@ -104,8 +104,7 @@ typedef SharedPtr<MockMediaAdapterImpl> MockMediaAdapterImplPtr; class MediaManagerImplTest : public ::testing::Test { public: - // media_adapter_mock_ will be deleted in media_manager_impl (dtor) - MediaManagerImplTest() : media_adapter_mock_(new MockMediaAdapter()) { + MediaManagerImplTest() { media_adapter_listener_mock_ = utils::MakeShared<MockMediaAdapterListener>(); ON_CALL(mock_media_manager_settings_, video_server_type()) @@ -205,7 +204,6 @@ class MediaManagerImplTest : public ::testing::Test { application_manager_test::MockApplicationManager app_mngr_; MockAppPtr mock_app_; SharedPtr<MockMediaAdapterListener> media_adapter_listener_mock_; - MockMediaAdapter* media_adapter_mock_; const ::testing::NiceMock<MockMediaManagerSettings> mock_media_manager_settings_; SharedPtr<MediaManagerImpl> media_manager_impl_; @@ -277,14 +275,17 @@ TEST_F(MediaManagerImplTest, Init_Settings_ExpectFileValue) { } TEST_F(MediaManagerImplTest, PlayA2DPSource_WithCorrectA2DP_SUCCESS) { - media_manager_impl_->set_mock_a2dp_player(media_adapter_mock_); - EXPECT_CALL(*media_adapter_mock_, StartActivity(kApplicationKey)); + // media_adapter_mock_ will be deleted in media_manager_impl (dtor) + MockMediaAdapter* media_adapter_mock = new MockMediaAdapter(); + media_manager_impl_->set_mock_a2dp_player(media_adapter_mock); + EXPECT_CALL(*media_adapter_mock, StartActivity(kApplicationKey)); media_manager_impl_->PlayA2DPSource(kApplicationKey); } TEST_F(MediaManagerImplTest, StopA2DPSource_WithCorrectA2DP_SUCCESS) { - media_manager_impl_->set_mock_a2dp_player(media_adapter_mock_); - EXPECT_CALL(*media_adapter_mock_, StopActivity(kApplicationKey)); + MockMediaAdapter* media_adapter_mock = new MockMediaAdapter(); + media_manager_impl_->set_mock_a2dp_player(media_adapter_mock); + EXPECT_CALL(*media_adapter_mock, StopActivity(kApplicationKey)); media_manager_impl_->StopA2DPSource(kApplicationKey); } |