diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2015-11-26 02:37:24 +0100 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2015-11-26 02:37:24 +0100 |
| commit | 47c48c8429f3ebfcb11fbe74746bf9ad51bd4779 (patch) | |
| tree | f030f6cbfcae0367945c2876dc698d725b058fe7 /tests | |
| parent | b0747e6a7c46c7b1038e3c8600f27e6c1d4a8121 (diff) | |
TestVolumeLauncherIcon: add tests for checking the visibilty on blacklisted devices with windows
(bzr r4036.11.36)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_volume_launcher_icon.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_volume_launcher_icon.cpp b/tests/test_volume_launcher_icon.cpp index 8e06919c8..aae3b2875 100644 --- a/tests/test_volume_launcher_icon.cpp +++ b/tests/test_volume_launcher_icon.cpp @@ -320,6 +320,32 @@ TEST_F(TestVolumeLauncherIconDelayedConstruction, TestVisibilityAfterUnmount_Bla EXPECT_FALSE(icon_->GetQuirk(AbstractLauncherIcon::Quirk::VISIBLE)); } +TEST_F(TestVolumeLauncherIcon, TestVisibilityWithWindows) +{ + ON_CALL(*settings_, IsABlacklistedDevice(volume_->GetIdentifier())).WillByDefault(Return(false)); + settings_->changed.emit(); + ASSERT_TRUE(icon_->GetQuirk(AbstractLauncherIcon::Quirk::VISIBLE)); + + auto win = std::make_shared<MockApplicationWindow::Nice>(g_random_int()); + ON_CALL(*file_manager_, WindowsForLocation(volume_->GetUri())).WillByDefault(Return(WindowList({win}))); + file_manager_->locations_changed.emit(); + + EXPECT_TRUE(icon_->GetQuirk(AbstractLauncherIcon::Quirk::VISIBLE)); +} + +TEST_F(TestVolumeLauncherIcon, TestVisibilityWithWindows_Blacklisted) +{ + ON_CALL(*settings_, IsABlacklistedDevice(volume_->GetIdentifier())).WillByDefault(Return(true)); + settings_->changed.emit(); + ASSERT_FALSE(icon_->GetQuirk(AbstractLauncherIcon::Quirk::VISIBLE)); + + auto win = std::make_shared<MockApplicationWindow::Nice>(g_random_int()); + ON_CALL(*file_manager_, WindowsForLocation(volume_->GetUri())).WillByDefault(Return(WindowList({win}))); + file_manager_->locations_changed.emit(); + + EXPECT_TRUE(icon_->GetQuirk(AbstractLauncherIcon::Quirk::VISIBLE)); +} + TEST_F(TestVolumeLauncherIcon, TestUnlockFromLauncherMenuItem_VolumeWithoutIdentifier) { EXPECT_CALL(*volume_, GetIdentifier()) |
