~azzar1/unity/fix-1028810

« back to all changes in this revision

Viewing changes to tests/test_bfb_launcher_icon.cpp

  • Committer: Andrea Azzarone
  • Date: 2012-08-22 13:14:18 UTC
  • mfrom: (2516.1.92 unity)
  • Revision ID: azzaronea@gmail.com-20120822131418-mrfwx82k39xnvl9e
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2012 Canonical Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License version 3, as published
 
6
 * by the  Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
10
 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
 
11
 * PURPOSE.  See the GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * version 3 along with this program.  If not, see
 
15
 * <http://www.gnu.org/licenses/>
 
16
 *
 
17
 * Authored by: Marco Trevisan (Treviño) <marco.trevisan@canonical.com>
 
18
 */
 
19
 
 
20
#include <gmock/gmock.h>
 
21
 
 
22
#include "BFBLauncherIcon.h"
 
23
 
 
24
using namespace unity;
 
25
using namespace unity::launcher;
 
26
 
 
27
namespace
 
28
{
 
29
 
 
30
class MockBFBLauncherIcon : public BFBLauncherIcon
 
31
{
 
32
public:
 
33
  MockBFBLauncherIcon()
 
34
    : BFBLauncherIcon(LauncherHideMode::LAUNCHER_HIDE_NEVER)
 
35
  {}
 
36
 
 
37
  AbstractLauncherIcon::MenuItemsVector GetMenus()
 
38
  {
 
39
    return BFBLauncherIcon::GetMenus();
 
40
  }
 
41
};
 
42
 
 
43
TEST(TestBFBLauncherIcon, OverlayMenus)
 
44
{
 
45
  MockBFBLauncherIcon bfb;
 
46
 
 
47
  for (auto menu_item : bfb.GetMenus())
 
48
  {
 
49
    bool overlay_item = dbusmenu_menuitem_property_get_bool(menu_item, QuicklistMenuItem::OVERLAY_MENU_ITEM_PROPERTY);
 
50
    ASSERT_TRUE(overlay_item);
 
51
  }
 
52
}
 
53
 
 
54
}