diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2013-09-11 12:45:10 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2013-09-11 12:45:10 +0200 |
| commit | 8605428ee3a7cacb86f2f1c0389698fcb23220bd (patch) | |
| tree | c50865c0ee46a54c784013285c8aca278daf2b34 /tests | |
| parent | 8650bf8c75c5ff57d3714b428411f9a095d3546e (diff) | |
TestApplicationLauncherIcon: verify leave events logging
(bzr r3477.6.20)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_application_launcher_icon.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/test_application_launcher_icon.cpp b/tests/test_application_launcher_icon.cpp index 8f5087121..757cfc4e0 100644 --- a/tests/test_application_launcher_icon.cpp +++ b/tests/test_application_launcher_icon.cpp @@ -66,6 +66,7 @@ struct MockApplicationLauncherIcon : ApplicationLauncherIcon using ApplicationLauncherIcon::IsFileManager; using ApplicationLauncherIcon::LogUnityEvent; + using ApplicationLauncherIcon::Remove; }; MATCHER_P(AreArgsEqual, a, "") @@ -291,10 +292,10 @@ TEST_F(TestApplicationLauncherIcon, UnstickNotRunning) bool forgot = false; bool removed = false; + usc_icon->Stick(); usc_icon->position_forgot.connect([&forgot] {forgot = true;}); usc_icon->remove.connect([&removed] (AbstractLauncherIcon::Ptr const&) { removed = true; }); - usc_icon->Stick(); usc_icon->UnStick(); EXPECT_FALSE(usc_app->sticky()); EXPECT_FALSE(usc_icon->IsSticky()); @@ -310,10 +311,10 @@ TEST_F(TestApplicationLauncherIcon, UnstickRunning) bool forgot = false; bool removed = false; + usc_icon->Stick(); usc_icon->position_forgot.connect([&forgot] {forgot = true;}); usc_icon->remove.connect([&removed] (AbstractLauncherIcon::Ptr const&) { removed = true; }); - usc_icon->Stick(); usc_icon->UnStick(); EXPECT_FALSE(usc_app->sticky()); EXPECT_FALSE(usc_icon->IsSticky()); @@ -322,15 +323,20 @@ TEST_F(TestApplicationLauncherIcon, UnstickRunning) EXPECT_FALSE(removed); } -TEST_F(TestApplicationLauncherIcon, UnstickDesktopApp) +TEST_F(TestApplicationLauncherIcon, UnstickDesktopAppLogEvents) { usc_icon->Stick(); + { + InSequence order; EXPECT_CALL(*unity_app_, LogEvent(ApplicationEventType::ACCESS, _)); + EXPECT_CALL(*unity_app_, LogEvent(ApplicationEventType::LEAVE, _)); + } + usc_icon->UnStick(); } -TEST_F(TestApplicationLauncherIcon, UnstickDesktopLessApp) +TEST_F(TestApplicationLauncherIcon, UnstickDesktopLessAppLogEvent) { auto app = std::make_shared<MockApplication::Nice>(); MockApplicationLauncherIcon::Ptr icon(new NiceMock<MockApplicationLauncherIcon>(app)); @@ -1097,4 +1103,10 @@ TEST_F(TestApplicationLauncherIcon, LogUnityEventDesktop) usc_icon->LogUnityEvent(ApplicationEventType::ACCESS); } +TEST_F(TestApplicationLauncherIcon, RemoveLogEvent) +{ + EXPECT_CALL(*unity_app_, LogEvent(ApplicationEventType::LEAVE, _)); + usc_icon->Remove(); +} + } |
