diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2012-08-13 18:17:22 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2012-08-13 18:17:22 +0200 |
| commit | 00695004aceb0c495545a0e06d5b5ba93fab0c4b (patch) | |
| tree | 0e0af04071b0bfa72bdfaa83d36a15d245bf61f8 | |
| parent | 2508006ee318a4bc337e6cd5d08488a240668a3c (diff) | |
test_bfb_launcher_icon: add BFB tests to check if the menu items are overlay items
(bzr r2547.2.6)
| -rw-r--r-- | tests/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | tests/test_bfb_launcher_icon.cpp | 54 |
2 files changed, 55 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9e43ed69f..26adb31cf 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -200,6 +200,7 @@ if (GTEST_SRC_DIR AND add_executable(test-gtest test_main.cpp test_bamflaunchericon.cpp + test_bfb_launcher_icon.cpp test_dashview_impl.cpp test_edge_barrier_controller.cpp test_launcher.cpp diff --git a/tests/test_bfb_launcher_icon.cpp b/tests/test_bfb_launcher_icon.cpp new file mode 100644 index 000000000..858469d5e --- /dev/null +++ b/tests/test_bfb_launcher_icon.cpp @@ -0,0 +1,54 @@ +/* + * Copyright 2012 Canonical Ltd. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * version 3 along with this program. If not, see + * <http://www.gnu.org/licenses/> + * + * Authored by: Marco Trevisan (Treviño) <marco.trevisan@canonical.com> + */ + +#include <gmock/gmock.h> + +#include "BFBLauncherIcon.h" + +using namespace unity; +using namespace unity::launcher; + +namespace +{ + +class MockBFBLauncherIcon : public BFBLauncherIcon +{ +public: + MockBFBLauncherIcon() + : BFBLauncherIcon(LauncherHideMode::LAUNCHER_HIDE_NEVER) + {} + + std::list<DbusmenuMenuitem*> GetMenus() + { + return BFBLauncherIcon::GetMenus(); + } +}; + +TEST(TestBFBLauncherIcon, OverlayMenus) +{ + MockBFBLauncherIcon bfb; + + for (auto menu_item : bfb.GetMenus()) + { + bool overlay_item = dbusmenu_menuitem_property_get_bool(menu_item, QuicklistMenuItem::OVERLAY_MENU_ITEM_PROPERTY); + ASSERT_TRUE(overlay_item); + } +} + +} |
