Merge lp:~3v1n0/unity/app-icon-ensure-on-running-6.0 into lp:unity/6.0

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 2777
Proposed branch: lp:~3v1n0/unity/app-icon-ensure-on-running-6.0
Merge into: lp:unity/6.0
Diff against target: 508 lines (+347/-18)
6 files modified
launcher/BamfLauncherIcon.cpp (+22/-8)
tests/CMakeLists.txt (+1/-0)
tests/bamf-mock-application.c (+201/-0)
tests/bamf-mock-application.h (+77/-0)
tests/test_bamf_launcher_icon.cpp (+43/-8)
tests/test_launcher_controller.cpp (+3/-2)
To merge this branch: bzr merge lp:~3v1n0/unity/app-icon-ensure-on-running-6.0
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
Review via email: mp+129470@code.launchpad.net

Commit message

BamfLauncherIcon: ensure the icon and name values when the running state changes

This avoids to get "?" icons

Description of the change

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'launcher/BamfLauncherIcon.cpp'
--- launcher/BamfLauncherIcon.cpp 2012-09-28 22:33:55 +0000
+++ launcher/BamfLauncherIcon.cpp 2012-10-12 18:26:21 +0000
@@ -81,7 +81,7 @@
81 glib::SignalBase* sig;81 glib::SignalBase* sig;
8282
83 sig = new glib::Signal<void, BamfView*, BamfView*>(bamf_view, "child-added",83 sig = new glib::Signal<void, BamfView*, BamfView*>(bamf_view, "child-added",
84 [&] (BamfView*, BamfView*) {84 [this] (BamfView*, BamfView*) {
85 EnsureWindowState();85 EnsureWindowState();
86 UpdateMenus();86 UpdateMenus();
87 UpdateIconGeometries(GetCenters());87 UpdateIconGeometries(GetCenters());
@@ -89,7 +89,7 @@
89 _gsignals.Add(sig);89 _gsignals.Add(sig);
9090
91 sig = new glib::Signal<void, BamfView*, BamfView*>(bamf_view, "child-removed",91 sig = new glib::Signal<void, BamfView*, BamfView*>(bamf_view, "child-removed",
92 [&] (BamfView*, BamfView*) { EnsureWindowState(); });92 [this] (BamfView*, BamfView*) { EnsureWindowState(); });
93 _gsignals.Add(sig);93 _gsignals.Add(sig);
9494
95 sig = new glib::Signal<void, BamfView*, BamfView*>(bamf_view, "child-moved",95 sig = new glib::Signal<void, BamfView*, BamfView*>(bamf_view, "child-moved",
@@ -99,39 +99,53 @@
99 _gsignals.Add(sig);99 _gsignals.Add(sig);
100100
101 sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "urgent-changed",101 sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "urgent-changed",
102 [&] (BamfView*, gboolean urgent) {102 [this] (BamfView*, gboolean urgent) {
103 SetQuirk(Quirk::URGENT, urgent);103 SetQuirk(Quirk::URGENT, urgent);
104 });104 });
105 _gsignals.Add(sig);105 _gsignals.Add(sig);
106106
107 sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "active-changed",107 sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "active-changed",
108 [&] (BamfView*, gboolean active) {108 [this] (BamfView*, gboolean active) {
109 SetQuirk(Quirk::ACTIVE, active);109 SetQuirk(Quirk::ACTIVE, active);
110 });110 });
111 _gsignals.Add(sig);111 _gsignals.Add(sig);
112112
113 sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "running-changed",113 sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "running-changed",
114 [&] (BamfView*, gboolean running) {114 [this] (BamfView* view, gboolean running) {
115 SetQuirk(Quirk::RUNNING, running);115 SetQuirk(Quirk::RUNNING, running);
116116
117 if (running)117 if (running)
118 {118 {
119 _source_manager.Remove(ICON_REMOVE_TIMEOUT);
120
121 /* It can happen that these values are not set
122 * during initialization if the view is closed
123 * very early, so we need to make sure that they
124 * are updated as soon as the view is re-opened. */
125 if (tooltip_text().empty())
126 tooltip_text = BamfName();
127
128 if (icon_name == DEFAULT_ICON)
129 {
130 glib::String icon(bamf_view_get_icon(view));
131 icon_name = (icon ? icon.Str() : DEFAULT_ICON);
132 }
133
119 EnsureWindowState();134 EnsureWindowState();
120 UpdateIconGeometries(GetCenters());135 UpdateIconGeometries(GetCenters());
121 _source_manager.Remove(ICON_REMOVE_TIMEOUT);
122 }136 }
123 });137 });
124 _gsignals.Add(sig);138 _gsignals.Add(sig);
125139
126 sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "user-visible-changed",140 sig = new glib::Signal<void, BamfView*, gboolean>(bamf_view, "user-visible-changed",
127 [&] (BamfView*, gboolean visible) {141 [this] (BamfView*, gboolean visible) {
128 if (!IsSticky())142 if (!IsSticky())
129 SetQuirk(Quirk::VISIBLE, visible);143 SetQuirk(Quirk::VISIBLE, visible);
130 });144 });
131 _gsignals.Add(sig);145 _gsignals.Add(sig);
132146
133 sig = new glib::Signal<void, BamfView*>(bamf_view, "closed",147 sig = new glib::Signal<void, BamfView*>(bamf_view, "closed",
134 [&] (BamfView*) {148 [this] (BamfView*) {
135 if (!IsSticky())149 if (!IsSticky())
136 {150 {
137 SetQuirk(Quirk::VISIBLE, false);151 SetQuirk(Quirk::VISIBLE, false);
138152
=== modified file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 2012-10-09 10:48:30 +0000
+++ tests/CMakeLists.txt 2012-10-12 18:26:21 +0000
@@ -244,6 +244,7 @@
244 test_unity_settings.cpp244 test_unity_settings.cpp
245 test_volume_imp.cpp245 test_volume_imp.cpp
246 test_volume_launcher_icon.cpp246 test_volume_launcher_icon.cpp
247 bamf-mock-application.c
247 gmockmount.c248 gmockmount.c
248 gmockvolume.c249 gmockvolume.c
249 ${CMAKE_SOURCE_DIR}/dash/AbstractPlacesGroup.cpp250 ${CMAKE_SOURCE_DIR}/dash/AbstractPlacesGroup.cpp
250251
=== added file 'tests/bamf-mock-application.c'
--- tests/bamf-mock-application.c 1970-01-01 00:00:00 +0000
+++ tests/bamf-mock-application.c 2012-10-12 18:26:21 +0000
@@ -0,0 +1,201 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/*
3 * Copyright 2012 Canonical Ltd.
4 *
5 * This program is free software: you can redistribute it and/or modify it
6 * under the terms of the GNU Lesser General Public License version 3, as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranties of
11 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
12 * PURPOSE. See the applicable version of the GNU Lesser General Public
13 * License for more details.
14 *
15 * You should have received a copy of both the GNU Lesser General Public
16 * License version 3 along with this program. If not, see
17 * <http://www.gnu.org/licenses/>
18 *
19 * Authored by: Marco Trevisan <marco.trevisan@canonical.com>
20 *
21 */
22
23#include "bamf-mock-application.h"
24
25G_DEFINE_TYPE (BamfMockApplication, bamf_mock_application, BAMF_TYPE_APPLICATION);
26
27#define BAMF_MOCK_APPLICATION_GET_PRIVATE(o) \
28 (G_TYPE_INSTANCE_GET_PRIVATE ((o), BAMF_TYPE_MOCK_APPLICATION, BamfMockApplicationPrivate))
29
30struct _BamfMockApplicationPrivate
31{
32 gboolean active;
33 gboolean running;
34 gboolean urgent;
35 gchar * name;
36 gchar * icon;
37 GList * children;
38};
39
40void
41bamf_mock_application_set_active (BamfMockApplication * self, gboolean active)
42{
43 g_return_if_fail (BAMF_IS_MOCK_APPLICATION (self));
44
45 if (self->priv->active != active)
46 {
47 self->priv->active = active;
48 g_signal_emit_by_name (G_OBJECT (self), "active-changed", active, NULL);
49 }
50}
51
52void
53bamf_mock_application_set_running (BamfMockApplication * self, gboolean running)
54{
55 g_return_if_fail (BAMF_IS_MOCK_APPLICATION (self));
56
57 if (self->priv->running != running)
58 {
59 self->priv->running = running;
60 g_signal_emit_by_name (G_OBJECT (self), "running-changed", running, NULL);
61 }
62}
63
64void
65bamf_mock_application_set_urgent (BamfMockApplication * self, gboolean urgent)
66{
67 g_return_if_fail (BAMF_IS_MOCK_APPLICATION (self));
68
69 if (self->priv->urgent != urgent)
70 {
71 self->priv->urgent = urgent;
72 g_signal_emit_by_name (G_OBJECT (self), "urgent-changed", urgent, NULL);
73 }
74}
75
76void
77bamf_mock_application_set_name (BamfMockApplication * self, const gchar * name)
78{
79 g_return_if_fail (BAMF_IS_MOCK_APPLICATION (self));
80
81 if (g_strcmp0 (self->priv->name, name) != 0)
82 {
83 char *old = self->priv->name;
84 self->priv->name = g_strdup (name);
85 g_signal_emit_by_name (G_OBJECT (self), "name-changed", old, self->priv->name, NULL);
86 g_free (old);
87 }
88}
89
90void
91bamf_mock_application_set_icon (BamfMockApplication * self, const gchar * icon)
92{
93 g_return_if_fail (BAMF_IS_MOCK_APPLICATION (self));
94
95 g_free (self->priv->icon);
96 self->priv->icon = g_strdup (icon);
97}
98
99void
100bamf_mock_application_set_children (BamfMockApplication * self, GList * children)
101{
102 g_return_if_fail (BAMF_IS_MOCK_APPLICATION (self));
103
104 g_list_free (self->priv->children);
105 self->priv->children = g_list_copy (children);
106}
107
108static void
109bamf_mock_application_finalize (GObject *object)
110{
111 BamfMockApplication *self = BAMF_MOCK_APPLICATION (object);
112
113 g_free (self->priv->name);
114 g_free (self->priv->icon);
115 g_list_free (self->priv->children);
116}
117
118static GList *
119bamf_mock_application_get_children (BamfView *view)
120{
121 g_return_val_if_fail (BAMF_IS_MOCK_APPLICATION (view), NULL);
122 BamfMockApplication *self = BAMF_MOCK_APPLICATION (view);
123 return g_list_copy (self->priv->children);
124}
125
126static gboolean
127bamf_mock_application_is_active (BamfView *view)
128{
129 g_return_val_if_fail (BAMF_IS_MOCK_APPLICATION (view), FALSE);
130 BamfMockApplication *self = BAMF_MOCK_APPLICATION (view);
131 return self->priv->active;
132}
133
134static gboolean
135bamf_mock_application_is_running (BamfView *view)
136{
137 g_return_val_if_fail (BAMF_IS_MOCK_APPLICATION (view), FALSE);
138 BamfMockApplication *self = BAMF_MOCK_APPLICATION (view);
139 return self->priv->running;
140}
141
142static gboolean
143bamf_mock_application_is_urgent (BamfView *view)
144{
145 g_return_val_if_fail (BAMF_IS_MOCK_APPLICATION (view), FALSE);
146 BamfMockApplication *self = BAMF_MOCK_APPLICATION (view);
147 return self->priv->urgent;
148}
149
150static char *
151bamf_mock_application_get_name (BamfView *view)
152{
153 g_return_val_if_fail (BAMF_IS_MOCK_APPLICATION (view), NULL);
154 BamfMockApplication *self = BAMF_MOCK_APPLICATION (view);
155 return g_strdup (self->priv->name);
156}
157
158static char *
159bamf_mock_application_get_icon (BamfView *view)
160{
161 g_return_val_if_fail (BAMF_IS_MOCK_APPLICATION (view), NULL);
162 BamfMockApplication *self = BAMF_MOCK_APPLICATION (view);
163 return g_strdup (self->priv->icon);
164}
165
166static const char *
167bamf_mock_application_view_type (BamfView *view)
168{
169 g_return_val_if_fail (BAMF_IS_MOCK_APPLICATION (view), NULL);
170 return "mock-application";
171}
172
173static void
174bamf_mock_application_class_init (BamfMockApplicationClass *klass)
175{
176 GObjectClass *obj_class = G_OBJECT_CLASS (klass);
177 BamfViewClass *view_class = BAMF_VIEW_CLASS (klass);
178
179 obj_class->finalize = bamf_mock_application_finalize;
180 view_class->get_children = bamf_mock_application_get_children;
181 view_class->is_active = bamf_mock_application_is_active;
182 view_class->is_running = bamf_mock_application_is_running;
183 view_class->is_urgent = bamf_mock_application_is_urgent;
184 view_class->get_name = bamf_mock_application_get_name;
185 view_class->get_icon = bamf_mock_application_get_icon;
186 view_class->view_type = bamf_mock_application_view_type;
187
188 g_type_class_add_private (obj_class, sizeof (BamfMockApplicationPrivate));
189}
190
191static void
192bamf_mock_application_init (BamfMockApplication *self)
193{
194 self->priv = BAMF_MOCK_APPLICATION_GET_PRIVATE (self);
195}
196
197BamfMockApplication *
198bamf_mock_application_new ()
199{
200 return g_object_new (BAMF_TYPE_MOCK_APPLICATION, NULL);
201}
0\ No newline at end of file202\ No newline at end of file
1203
=== added file 'tests/bamf-mock-application.h'
--- tests/bamf-mock-application.h 1970-01-01 00:00:00 +0000
+++ tests/bamf-mock-application.h 2012-10-12 18:26:21 +0000
@@ -0,0 +1,77 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/*
3 * Copyright 2012 Canonical Ltd.
4 *
5 * This program is free software: you can redistribute it and/or modify it
6 * under the terms of the GNU Lesser General Public License version 3, as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranties of
11 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
12 * PURPOSE. See the applicable version of the GNU Lesser General Public
13 * License for more details.
14 *
15 * You should have received a copy of both the GNU Lesser General Public
16 * License version 3 along with this program. If not, see
17 * <http://www.gnu.org/licenses/>
18 *
19 * Authored by: Marco Trevisan <marco.trevisan@canonical.com>
20 *
21 */
22
23#ifndef MOCK_BAMF_MOCK_APPLICATION
24#define MOCK_BAMF_MOCK_APPLICATION
25
26#include <libbamf/libbamf.h>
27
28G_BEGIN_DECLS
29
30#define BAMF_TYPE_MOCK_APPLICATION (bamf_mock_application_get_type ())
31
32#define BAMF_MOCK_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
33 BAMF_TYPE_MOCK_APPLICATION, BamfMockApplication))
34
35#define BAMF_MOCK_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),\
36 BAMF_TYPE_MOCK_APPLICATION, BamfMockApplicationClass))
37
38#define BAMF_IS_MOCK_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
39 BAMF_TYPE_MOCK_APPLICATION))
40
41#define BAMF_IS_MOCK_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),\
42 BAMF_TYPE_MOCK_APPLICATION))
43
44#define BAMF_MOCK_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),\
45 BAMF_TYPE_MOCK_APPLICATION, BamfMockApplicationClass))
46
47typedef struct _BamfMockApplication BamfMockApplication;
48typedef struct _BamfMockApplicationClass BamfMockApplicationClass;
49typedef struct _BamfMockApplicationPrivate BamfMockApplicationPrivate;
50
51struct _BamfMockApplication
52{
53 BamfApplication parent;
54
55 BamfMockApplicationPrivate *priv;
56};
57
58struct _BamfMockApplicationClass
59{
60 BamfApplicationClass parent_class;
61};
62
63GType bamf_mock_application_get_type (void) G_GNUC_CONST;
64
65BamfMockApplication * bamf_mock_application_new ();
66
67void bamf_mock_application_set_active (BamfMockApplication * self, gboolean active);
68void bamf_mock_application_set_running (BamfMockApplication * self, gboolean running);
69void bamf_mock_application_set_urgent (BamfMockApplication * self, gboolean urgent);
70void bamf_mock_application_set_name (BamfMockApplication * self, const gchar * name);
71void bamf_mock_application_set_icon (BamfMockApplication * self, const gchar * icon);
72void bamf_mock_application_set_children (BamfMockApplication * self, GList * children);
73
74G_END_DECLS
75
76#endif
77
078
=== modified file 'tests/test_bamf_launcher_icon.cpp'
--- tests/test_bamf_launcher_icon.cpp 2012-09-18 15:47:49 +0000
+++ tests/test_bamf_launcher_icon.cpp 2012-10-12 18:26:21 +0000
@@ -27,6 +27,7 @@
2727
28#include "BamfLauncherIcon.h"28#include "BamfLauncherIcon.h"
29#include "FavoriteStore.h"29#include "FavoriteStore.h"
30#include "bamf-mock-application.h"
3031
31using namespace unity;32using namespace unity;
32using namespace unity::launcher;33using namespace unity::launcher;
@@ -34,6 +35,7 @@
34namespace35namespace
35{36{
3637
38const std::string DEFAULT_EMPTY_ICON = "application-default-icon";
37const std::string USC_DESKTOP = BUILDDIR"/tests/data/applications/ubuntu-software-center.desktop";39const std::string USC_DESKTOP = BUILDDIR"/tests/data/applications/ubuntu-software-center.desktop";
38const std::string NO_ICON_DESKTOP = BUILDDIR"/tests/data/applications/no-icon.desktop";40const std::string NO_ICON_DESKTOP = BUILDDIR"/tests/data/applications/no-icon.desktop";
3941
@@ -53,15 +55,16 @@
53 empty_icon = new launcher::BamfLauncherIcon(bamf_app);55 empty_icon = new launcher::BamfLauncherIcon(bamf_app);
54 ASSERT_EQ(empty_icon->DesktopFile(), NO_ICON_DESKTOP);56 ASSERT_EQ(empty_icon->DesktopFile(), NO_ICON_DESKTOP);
5557
56 bamf_app = static_cast<BamfApplication*>(g_object_new(BAMF_TYPE_APPLICATION, nullptr));58 mock_app = bamf_mock_application_new();
57 empty_app = new launcher::BamfLauncherIcon(bamf_app);59 mock_icon = new launcher::BamfLauncherIcon(glib::object_cast<BamfApplication>(mock_app));
58 ASSERT_TRUE(empty_app->DesktopFile().empty());60 ASSERT_TRUE(mock_icon->DesktopFile().empty());
59 }61 }
6062
61 glib::Object<BamfMatcher> bamf_matcher;63 glib::Object<BamfMatcher> bamf_matcher;
64 glib::Object<BamfMockApplication> mock_app;
62 nux::ObjectPtr<launcher::BamfLauncherIcon> usc_icon;65 nux::ObjectPtr<launcher::BamfLauncherIcon> usc_icon;
63 nux::ObjectPtr<launcher::BamfLauncherIcon> empty_icon;66 nux::ObjectPtr<launcher::BamfLauncherIcon> empty_icon;
64 nux::ObjectPtr<launcher::BamfLauncherIcon> empty_app;67 nux::ObjectPtr<launcher::BamfLauncherIcon> mock_icon;
65};68};
6669
67TEST_F(TestBamfLauncherIcon, Position)70TEST_F(TestBamfLauncherIcon, Position)
@@ -81,9 +84,9 @@
8184
82TEST_F(TestBamfLauncherIcon, TestDefaultIcon)85TEST_F(TestBamfLauncherIcon, TestDefaultIcon)
83{86{
84 EXPECT_EQ(usc_icon->icon_name.Get(), "softwarecenter");87 EXPECT_EQ(usc_icon->icon_name(), "softwarecenter");
85 EXPECT_EQ(empty_icon->icon_name.Get(), "application-default-icon");88 EXPECT_EQ(empty_icon->icon_name(), DEFAULT_EMPTY_ICON);
86 EXPECT_EQ(empty_app->icon_name.Get(), "application-default-icon");89 EXPECT_EQ(mock_icon->icon_name(), DEFAULT_EMPTY_ICON);
87}90}
8891
89TEST_F(TestBamfLauncherIcon, Stick)92TEST_F(TestBamfLauncherIcon, Stick)
@@ -143,7 +146,39 @@
143TEST_F(TestBamfLauncherIcon, RemoteUri)146TEST_F(TestBamfLauncherIcon, RemoteUri)
144{147{
145 EXPECT_EQ(usc_icon->RemoteUri(), FavoriteStore::URI_PREFIX_APP + DesktopUtilities::GetDesktopID(USC_DESKTOP));148 EXPECT_EQ(usc_icon->RemoteUri(), FavoriteStore::URI_PREFIX_APP + DesktopUtilities::GetDesktopID(USC_DESKTOP));
146 EXPECT_TRUE(empty_app->RemoteUri().empty());149 EXPECT_TRUE(mock_icon->RemoteUri().empty());
150}
151
152TEST_F(TestBamfLauncherIcon, EmptyTooltipUpdatesOnRunning)
153{
154 ASSERT_TRUE(mock_icon->tooltip_text().empty());
155 bamf_mock_application_set_name (mock_app, "Got Name");
156
157 ASSERT_TRUE(mock_icon->tooltip_text().empty());
158
159 bamf_mock_application_set_running(mock_app, TRUE);
160 EXPECT_EQ(mock_icon->tooltip_text(), "Got Name");
161
162 bamf_mock_application_set_running(mock_app, FALSE);
163 bamf_mock_application_set_name (mock_app, "New Name");
164 bamf_mock_application_set_running(mock_app, TRUE);
165 EXPECT_EQ(mock_icon->tooltip_text(), "Got Name");
166}
167
168TEST_F(TestBamfLauncherIcon, InvalidIconUpdatesOnRunning)
169{
170 ASSERT_EQ(mock_icon->icon_name(), DEFAULT_EMPTY_ICON);
171 bamf_mock_application_set_icon (mock_app, "icon-name");
172
173 ASSERT_EQ(mock_icon->icon_name(), DEFAULT_EMPTY_ICON);
174
175 bamf_mock_application_set_running(mock_app, TRUE);
176 EXPECT_EQ(mock_icon->icon_name(), "icon-name");
177
178 bamf_mock_application_set_running(mock_app, FALSE);
179 bamf_mock_application_set_icon (mock_app, "new-icon-name");
180 bamf_mock_application_set_running(mock_app, TRUE);
181 EXPECT_EQ(mock_icon->icon_name(), "icon-name");
147}182}
148183
149}184}
150185
=== modified file 'tests/test_launcher_controller.cpp'
--- tests/test_launcher_controller.cpp 2012-09-28 11:32:04 +0000
+++ tests/test_launcher_controller.cpp 2012-10-12 18:26:21 +0000
@@ -18,7 +18,6 @@
18 */18 */
1919
20#include <gmock/gmock.h>20#include <gmock/gmock.h>
21#include "test_uscreen_mock.h"
2221
23#include "FavoriteStore.h"22#include "FavoriteStore.h"
24#include "LauncherController.h"23#include "LauncherController.h"
@@ -34,7 +33,9 @@
34#include "PanelStyle.h"33#include "PanelStyle.h"
35#include "UnitySettings.h"34#include "UnitySettings.h"
36#include "test_utils.h"35#include "test_utils.h"
36#include "test_uscreen_mock.h"
37#include "test_mock_devices.h"37#include "test_mock_devices.h"
38#include "bamf-mock-application.h"
3839
39using namespace unity::launcher;40using namespace unity::launcher;
40using namespace testing;41using namespace testing;
@@ -131,7 +132,7 @@
131 typedef bool Fake;132 typedef bool Fake;
132133
133 MockBamfLauncherIcon(Fake = true, std::string const& remote_uri = "")134 MockBamfLauncherIcon(Fake = true, std::string const& remote_uri = "")
134 : BamfLauncherIcon(static_cast<BamfApplication*>(g_object_new(BAMF_TYPE_APPLICATION, nullptr)))135 : BamfLauncherIcon(BAMF_APPLICATION(bamf_mock_application_new()))
135 , remote_uri_(remote_uri)136 , remote_uri_(remote_uri)
136 {137 {
137 InitMock();138 InitMock();

Subscribers

People subscribed via source and target branches