Merge lp:~unity-api-team/hud/test-failures into lp:hud/14.04

Proposed by Pete Woods
Status: Merged
Approved by: Pete Woods
Approved revision: 388
Merged at revision: 384
Proposed branch: lp:~unity-api-team/hud/test-failures
Merge into: lp:hud/14.04
Prerequisite: lp:~unity-api-team/hud/null-guard-itemstore
Diff against target: 534 lines (+105/-49)
18 files modified
libqtgmenu/internal/QtGActionGroup.cpp (+26/-12)
libqtgmenu/internal/QtGActionGroup.h (+1/-0)
libqtgmenu/internal/QtGMenuImporterPrivate.cpp (+10/-7)
libqtgmenu/internal/QtGMenuImporterPrivate.h (+1/-1)
libqtgmenu/internal/QtGMenuModel.cpp (+16/-5)
libqtgmenu/internal/QtGMenuModel.h (+4/-1)
libqtgmenu/internal/QtGMenuUtils.cpp (+14/-0)
libqtgmenu/internal/QtGMenuUtils.h (+3/-0)
service/ItemStore.cpp (+10/-2)
service/ItemStore.h (+1/-1)
service/QueryImpl.cpp (+1/-2)
service/Window.h (+1/-1)
service/WindowImpl.cpp (+3/-3)
service/WindowImpl.h (+1/-1)
tests/integration/TestHud.cpp (+1/-1)
tests/menus/test-menu-input-model-shortcuts.c (+4/-4)
tests/unit/qtgmenu/TestQtGMenu.cpp (+6/-6)
tests/unit/service/Mocks.h (+2/-2)
To merge this branch: bzr merge lp:~unity-api-team/hud/test-failures
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Antti Kaijanmäki (community) Approve
Review via email: mp+211594@code.launchpad.net

Commit message

Fix test failures exposed by fix to libqtdbustest

Description of the change

* Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
  * Yes
 * Did you build your software in a clean sbuild/pbuilder chroot or ppa?
  * Yes
 * Did you build your software in a clean sbuild/pbuilder armhf chroot or ppa?
  * Yes
 * Has your component "TestPlan” been executed successfully on emulator, N4?
  * Yes
 * Has a 5 minute exploratory testing run been executed on N4?
  * Yes
 * If you changed the packaging (debian), did you subscribe a core-dev to this MP?
  * N/A
 * If you changed the UI, did you subscribe the design-reviewers to this MP?
  * No change
 * What components might get impacted by your changes?
  * Unity7
  * Unity8
 * Have you requested review by the teams of these owning components?
  * Yes

Check List:
https://wiki.ubuntu.com/Process/Merges/Checklists/hud

Test Plan:
https://wiki.ubuntu.com/Process/Merges/TestPlan/hud

Silo:
<waiting for silo>

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

The submitter is supposed to be on HOLIDAY!

Please, resubmit next week.

review: Disapprove
Revision history for this message
Pete Woods (pete-woods) wrote :

You have a fair point. I really set up this branch for Marcus to hopefully have a look at the newly exposed test failures now I fixed the highly embarrassing bug in libqtdbustest (https://code.launchpad.net/~unity-team/libqtdbustest/handle-crashing-child-process/+merge/211586).

Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

OK, I will approve this one even though you are on holiday, but please not it's an exception! :)

review: Approve
Revision history for this message
Pete Woods (pete-woods) wrote :

This branch doesn't do anything useful yet. As I said, I'm hoping Marcus has the time at some point to have a look at the test failures in libqtgmenu.

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Alright, tests passing now. The tests themselves needed updating to actually use action prefixes as they were just stripped away before.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libqtgmenu/internal/QtGActionGroup.cpp'
2--- libqtgmenu/internal/QtGActionGroup.cpp 2014-03-20 10:03:07 +0000
3+++ libqtgmenu/internal/QtGActionGroup.cpp 2014-03-20 10:03:07 +0000
4@@ -72,34 +72,48 @@
5
6 void QtGActionGroup::TriggerAction( QString action_name, bool checked )
7 {
8- QString prefix = action_name.left( action_name.indexOf( '.' ) );
9+ QPair<QString, QString> split = QtGMenuUtils::splitPrefixAndName(action_name);
10+ const QString& prefix(split.first);
11+
12 if( prefix != m_action_prefix )
13 {
14 return;
15 }
16
17- action_name = action_name.right( action_name.size() - action_name.indexOf( '.' ) - 1 );
18- std::string action = action_name.toStdString();
19+ const QString& action(split.second);
20+ QByteArray action_utf = action.toUtf8();
21
22 const GVariantType* type = g_action_group_get_action_parameter_type( m_action_group,
23- action.c_str() );
24+ action_utf.constData() );
25
26 if( type == nullptr )
27 {
28- g_action_group_activate_action( m_action_group, action.c_str(), nullptr );
29+ g_action_group_activate_action( m_action_group, action_utf.constData(), nullptr );
30 }
31 else
32 {
33 ///! need to evaluate and send parameter value
34 if( g_variant_type_equal( type, G_VARIANT_TYPE_STRING ) )
35 {
36- GVariant* param = g_variant_new_string( action.c_str() );
37- g_action_group_activate_action( m_action_group, action.c_str(), param );
38+ GVariant* param = g_variant_new_string( action_utf.constData() );
39+ g_action_group_activate_action( m_action_group, action_utf.constData(), param );
40 g_variant_unref( param );
41 }
42 }
43 }
44
45+QString QtGActionGroup::FullName( const QString& prefix, const QString& action_name )
46+{
47+ if ( prefix.isEmpty() )
48+ {
49+ return action_name;
50+ }
51+ else
52+ {
53+ return prefix + "." + action_name;
54+ }
55+}
56+
57 void QtGActionGroup::EmitStates()
58 {
59 auto actions_list = g_action_group_list_actions( m_action_group );
60@@ -111,12 +125,12 @@
61 bool enabled = G_ACTION_GROUP_GET_IFACE( m_action_group ) ->get_action_enabled( m_action_group,
62 action_name );
63 if( !enabled )
64- emit ActionEnabled( m_action_prefix + "." + action_name, enabled );
65+ emit ActionEnabled( FullName(m_action_prefix, action_name), enabled );
66
67 const GVariantType* type = g_action_group_get_action_parameter_type( m_action_group,
68 action_name );
69 if( type != nullptr )
70- emit ActionParameterized( m_action_prefix + "." + action_name, type != nullptr );
71+ emit ActionParameterized( FullName(m_action_prefix, action_name), type != nullptr );
72 }
73
74 g_strfreev( actions_list );
75@@ -131,12 +145,12 @@
76 bool enabled = G_ACTION_GROUP_GET_IFACE( self->m_action_group ) ->get_action_enabled(
77 self->m_action_group, action_name );
78 if( !enabled )
79- emit self->ActionEnabled( self->m_action_prefix + "." + action_name, enabled );
80+ emit self->ActionEnabled( FullName(self->m_action_prefix, action_name), enabled );
81
82 const GVariantType* type = g_action_group_get_action_parameter_type( self->m_action_group,
83 action_name );
84 if( type != nullptr )
85- emit self->ActionParameterized( self->m_action_prefix + "." + action_name, type != nullptr );
86+ emit self->ActionParameterized( FullName(self->m_action_prefix, action_name), type != nullptr );
87 }
88
89 void QtGActionGroup::ActionRemovedCallback( GActionGroup* action_group, gchar* action_name,
90@@ -150,7 +164,7 @@
91 gboolean enabled, gpointer user_data )
92 {
93 QtGActionGroup* self = reinterpret_cast< QtGActionGroup* >( user_data );
94- emit self->ActionEnabled( self->m_action_prefix + "." + action_name, enabled );
95+ emit self->ActionEnabled( FullName(self->m_action_prefix, action_name), enabled );
96 }
97
98 void QtGActionGroup::ActionStateChangedCallback( GActionGroup* action_group, gchar* action_name,
99
100=== modified file 'libqtgmenu/internal/QtGActionGroup.h'
101--- libqtgmenu/internal/QtGActionGroup.h 2014-03-20 10:03:07 +0000
102+++ libqtgmenu/internal/QtGActionGroup.h 2014-03-20 10:03:07 +0000
103@@ -50,6 +50,7 @@
104 void EmitStates();
105
106 private:
107+ static QString FullName( const QString& prefix, const QString& name );
108 static void ActionAddedCallback( GActionGroup* action_group, gchar* action_name,
109 gpointer user_data );
110 static void ActionRemovedCallback( GActionGroup* action_group, gchar* action_name,
111
112=== modified file 'libqtgmenu/internal/QtGMenuImporterPrivate.cpp'
113--- libqtgmenu/internal/QtGMenuImporterPrivate.cpp 2014-03-12 04:19:08 +0000
114+++ libqtgmenu/internal/QtGMenuImporterPrivate.cpp 2014-03-20 10:03:07 +0000
115@@ -31,7 +31,7 @@
116 QDBusServiceWatcher::WatchForOwnerChange ),
117 m_parent( parent ),
118 m_connection( g_bus_get_sync( G_BUS_TYPE_SESSION, NULL, NULL ) ),
119- m_service( service.toStdString() ),
120+ m_service( service ),
121 m_menu_path( menu_path ),
122 m_action_paths( action_paths )
123 {
124@@ -162,8 +162,8 @@
125 QString menu_path = m_menu_path.path();
126 m_menu_model =
127 std::make_shared< QtGMenuModel > (
128- G_MENU_MODEL( g_dbus_menu_model_get( m_connection, m_service.c_str(), menu_path.toUtf8().constData() ) ),
129- m_service.c_str(), menu_path.toUtf8().constData() );
130+ G_MENU_MODEL( g_dbus_menu_model_get( m_connection, m_service.toUtf8().constData(), menu_path.toUtf8().constData() ) ),
131+ m_service, menu_path, m_action_paths );
132
133 connect( m_menu_model.get(), SIGNAL( MenuItemsChanged( QtGMenuModel*, int, int,
134 int ) ), &m_parent, SIGNAL( MenuItemsChanged()) );
135@@ -174,12 +174,15 @@
136 // clear the action groups for the refresh
137 ClearActionGroups();
138
139- for( auto const& action_path_it : m_action_paths.toStdMap() )
140+ QMapIterator<QString, QDBusObjectPath> action_path_it(m_action_paths);
141+ while( action_path_it.hasNext() )
142 {
143- QString action_path = action_path_it.second.path();
144+ action_path_it.next();
145+
146+ QString action_path = action_path_it.value().path();
147 m_action_groups.push_back(
148- std::make_shared< QtGActionGroup > ( action_path_it.first,
149- G_ACTION_GROUP( g_dbus_action_group_get( m_connection, m_service.c_str(), action_path.toUtf8().constData() ) ) ) );
150+ std::make_shared< QtGActionGroup > ( action_path_it.key(),
151+ G_ACTION_GROUP( g_dbus_action_group_get( m_connection, m_service.toUtf8().constData(), action_path.toUtf8().constData() ) ) ) );
152
153 auto action_group = m_action_groups.back();
154
155
156=== modified file 'libqtgmenu/internal/QtGMenuImporterPrivate.h'
157--- libqtgmenu/internal/QtGMenuImporterPrivate.h 2014-03-12 04:19:08 +0000
158+++ libqtgmenu/internal/QtGMenuImporterPrivate.h 2014-03-20 10:03:07 +0000
159@@ -69,7 +69,7 @@
160 QtGMenuImporter& m_parent;
161
162 GDBusConnection* m_connection;
163- std::string m_service;
164+ QString m_service;
165 QDBusObjectPath m_menu_path;
166 QMap<QString, QDBusObjectPath> m_action_paths;
167
168
169=== modified file 'libqtgmenu/internal/QtGMenuModel.cpp'
170--- libqtgmenu/internal/QtGMenuModel.cpp 2014-03-11 05:28:09 +0000
171+++ libqtgmenu/internal/QtGMenuModel.cpp 2014-03-20 10:03:07 +0000
172@@ -18,6 +18,7 @@
173
174 #include <QtGMenuModel.h>
175 #include <QtGMenuUtils.h>
176+#include <QDebug>
177
178 using namespace qtgmenu;
179
180@@ -26,11 +27,12 @@
181 {
182 }
183
184-QtGMenuModel::QtGMenuModel( GMenuModel* model, const QString& bus_name, const QString& menu_path )
185+QtGMenuModel::QtGMenuModel( GMenuModel* model, const QString& bus_name, const QString& menu_path, const QMap<QString, QDBusObjectPath>& action_paths )
186 : QtGMenuModel( model, LinkType::Root, nullptr, 0 )
187 {
188 m_bus_name = bus_name;
189 m_menu_path = menu_path;
190+ m_action_paths = action_paths;
191 }
192
193 QtGMenuModel::QtGMenuModel( GMenuModel* model, LinkType link_type, QtGMenuModel* parent, int index )
194@@ -46,6 +48,7 @@
195
196 m_bus_name = m_parent->m_bus_name;
197 m_menu_path = m_parent->m_menu_path;
198+ m_action_paths = m_parent->m_action_paths;
199
200 gchar* label = NULL;
201 if( g_menu_model_get_item_attribute( m_parent->m_model, index,
202@@ -59,15 +62,13 @@
203 }
204
205 gchar* action_name = NULL;
206+ QString qaction_name;
207 if( g_menu_model_get_item_attribute( m_parent->m_model, index,
208 G_MENU_ATTRIBUTE_ACTION, "s", &action_name ) )
209 {
210- QString qaction_name = QString::fromUtf8( action_name );
211+ qaction_name = QString::fromUtf8( action_name );
212 g_free( action_name );
213
214- int name_length = qaction_name.size() - qaction_name.indexOf( '.' ) - 1;
215- qaction_name = qaction_name.right( name_length );
216-
217 m_ext_menu->menuAction()->setProperty( c_property_actionName, qaction_name );
218 }
219
220@@ -84,6 +85,16 @@
221 // dbus paths
222 m_ext_menu->menuAction()->setProperty( c_property_busName, m_bus_name );
223 m_ext_menu->menuAction()->setProperty( c_property_menuPath, m_menu_path );
224+
225+ if( !qaction_name.isEmpty() )
226+ {
227+ QPair<QString, QString> split = QtGMenuUtils::splitPrefixAndName(qaction_name);
228+ const QString& prefix(split.first);
229+ if( m_action_paths.contains(prefix) )
230+ {
231+ m_ext_menu->menuAction()->setProperty( c_property_actionsPath, m_action_paths[prefix].path() );
232+ }
233+ }
234 }
235 }
236
237
238=== modified file 'libqtgmenu/internal/QtGMenuModel.h'
239--- libqtgmenu/internal/QtGMenuModel.h 2014-03-11 05:04:08 +0000
240+++ libqtgmenu/internal/QtGMenuModel.h 2014-03-20 10:03:07 +0000
241@@ -19,6 +19,7 @@
242 #ifndef QTGMENUMODEL_H
243 #define QTGMENUMODEL_H
244
245+#include <QDBusObjectPath>
246 #include <QObject>
247 #include <QMap>
248 #include <QMenu>
249@@ -43,7 +44,7 @@
250 };
251
252 explicit QtGMenuModel( GMenuModel* model );
253- QtGMenuModel( GMenuModel* model, const QString& bus_name, const QString& menu_path );
254+ QtGMenuModel( GMenuModel* model, const QString& bus_name, const QString& menu_path, const QMap<QString, QDBusObjectPath>& action_paths );
255 virtual ~QtGMenuModel();
256
257 GMenuModel* Model() const;
258@@ -59,6 +60,7 @@
259 constexpr static const char* c_property_actionName = "actionName";
260 constexpr static const char* c_property_isParameterized = "isParameterized";
261 constexpr static const char* c_property_busName = "busName";
262+ constexpr static const char* c_property_actionsPath = "actionsPath";
263 constexpr static const char* c_property_menuPath = "menuPath";
264 constexpr static const char* c_property_keywords = "keywords";
265 constexpr static const char* c_property_hud_toolbar_item = "hud-toolbar-item";
266@@ -113,6 +115,7 @@
267
268 QString m_bus_name;
269 QString m_menu_path;
270+ QMap<QString, QDBusObjectPath> m_action_paths;
271
272 std::map< QString, QAction* > m_actions;
273 };
274
275=== modified file 'libqtgmenu/internal/QtGMenuUtils.cpp'
276--- libqtgmenu/internal/QtGMenuUtils.cpp 2014-03-20 10:03:07 +0000
277+++ libqtgmenu/internal/QtGMenuUtils.cpp 2014-03-20 10:03:07 +0000
278@@ -229,3 +229,17 @@
279
280 return QKeySequence::fromString( shortcut );
281 }
282+
283+QPair<QString, QString> QtGMenuUtils::splitPrefixAndName( const QString& name )
284+{
285+ int index = name.indexOf( '.' );
286+
287+ if( index == -1 )
288+ {
289+ return qMakePair(QString(), name);
290+ }
291+ else
292+ {
293+ return qMakePair(name.left( index ), name.right( name.size() - index - 1 ));
294+ }
295+}
296
297=== modified file 'libqtgmenu/internal/QtGMenuUtils.h'
298--- libqtgmenu/internal/QtGMenuUtils.h 2013-11-18 13:08:31 +0000
299+++ libqtgmenu/internal/QtGMenuUtils.h 2014-03-20 10:03:07 +0000
300@@ -19,6 +19,8 @@
301 #ifndef QTGMENUUTILS_H
302 #define QTGMENUUTILS_H
303
304+#include <QPair>
305+
306 class _GVariant;
307 typedef _GVariant GVariant;
308
309@@ -34,6 +36,7 @@
310 public:
311 static QVariant GVariantToQVariant( GVariant* gvariant );
312 static QKeySequence QStringToQKeySequence( QString& shortcut );
313+ static QPair<QString, QString> splitPrefixAndName( const QString& name );
314 };
315
316 } // namespace qtgmenu
317
318=== modified file 'service/ItemStore.cpp'
319--- service/ItemStore.cpp 2014-03-20 10:03:07 +0000
320+++ service/ItemStore.cpp 2014-03-20 10:03:07 +0000
321@@ -279,7 +279,7 @@
322 }
323
324 QString ItemStore::executeParameterized(unsigned long long commandId,
325- QString &baseAction, QDBusObjectPath &actionPath,
326+ QString &prefix, QString &baseAction, QDBusObjectPath &actionPath,
327 QDBusObjectPath &modelPath) {
328
329 Item::Ptr item(m_items[commandId]);
330@@ -297,7 +297,15 @@
331 return QString();
332 }
333
334- baseAction = action->property("actionName").toString();
335+ QString name = action->property("actionName").toString();
336+ int index = name.indexOf( '.' );
337+ if (index == -1) {
338+ baseAction = name;
339+ } else {
340+ prefix = name.left(index);
341+ baseAction = name.right(name.size() - index - 1);
342+ }
343+
344 actionPath = QDBusObjectPath(action->property("actionsPath").toString());
345 modelPath = QDBusObjectPath(action->property("menuPath").toString());
346
347
348=== modified file 'service/ItemStore.h'
349--- service/ItemStore.h 2014-02-18 13:35:12 +0000
350+++ service/ItemStore.h 2014-03-20 10:03:07 +0000
351@@ -57,7 +57,7 @@
352 void execute(unsigned long long commandId);
353
354 QString executeParameterized(unsigned long long commandId,
355- QString &baseAction, QDBusObjectPath &actionPath,
356+ QString &prefix, QString &baseAction, QDBusObjectPath &actionPath,
357 QDBusObjectPath &modelPath);
358
359 void executeToolbar(const QString &item);
360
361=== modified file 'service/QueryImpl.cpp'
362--- service/QueryImpl.cpp 2014-02-18 13:35:12 +0000
363+++ service/QueryImpl.cpp 2014-03-20 10:03:07 +0000
364@@ -162,9 +162,8 @@
365 }
366
367 qulonglong commandId(item.variant().toULongLong());
368- prefix = "hud";
369 modelSection = 1;
370- return m_windowToken->executeParameterized(commandId, baseAction,
371+ return m_windowToken->executeParameterized(commandId, prefix, baseAction,
372 actionPath, modelPath);
373 }
374
375
376=== modified file 'service/Window.h'
377--- service/Window.h 2014-02-18 13:35:12 +0000
378+++ service/Window.h 2014-03-20 10:03:07 +0000
379@@ -42,7 +42,7 @@
380 virtual void execute(unsigned long long commandId) = 0;
381
382 virtual QString executeParameterized(unsigned long long commandId,
383- QString &baseAction, QDBusObjectPath &actionPath,
384+ QString &prefix, QString &baseAction, QDBusObjectPath &actionPath,
385 QDBusObjectPath &modelPath) = 0;
386
387 virtual void executeToolbar(const QString &item) = 0;
388
389=== modified file 'service/WindowImpl.cpp'
390--- service/WindowImpl.cpp 2014-03-05 12:59:07 +0000
391+++ service/WindowImpl.cpp 2014-03-20 10:03:07 +0000
392@@ -55,10 +55,10 @@
393 }
394
395 QString WindowTokenImpl::executeParameterized(unsigned long long commandId,
396- QString &baseAction, QDBusObjectPath &actionPath,
397+ QString &prefix, QString &baseAction, QDBusObjectPath &actionPath,
398 QDBusObjectPath &modelPath) {
399- return m_items->executeParameterized(commandId, baseAction, actionPath,
400- modelPath);
401+ return m_items->executeParameterized(commandId, prefix, baseAction,
402+ actionPath, modelPath);
403 }
404
405 void WindowTokenImpl::executeToolbar(const QString &item) {
406
407=== modified file 'service/WindowImpl.h'
408--- service/WindowImpl.h 2014-02-18 13:35:12 +0000
409+++ service/WindowImpl.h 2014-03-20 10:03:07 +0000
410@@ -49,7 +49,7 @@
411
412 void execute(unsigned long long commandId) override;
413
414- QString executeParameterized(unsigned long long commandId,
415+ QString executeParameterized(unsigned long long commandId, QString &prefix,
416 QString &baseAction, QDBusObjectPath &actionPath,
417 QDBusObjectPath &modelPath) override;
418
419
420=== modified file 'tests/integration/TestHud.cpp'
421--- tests/integration/TestHud.cpp 2014-03-05 12:59:07 +0000
422+++ tests/integration/TestHud.cpp 2014-03-20 10:03:07 +0000
423@@ -373,7 +373,7 @@
424 EXPECT_FALSE(executedSpy.isEmpty());
425
426 actionInvokedSpy.wait();
427- EXPECT_FALSE(actionInvokedSpy.isEmpty());
428+ ASSERT_FALSE(actionInvokedSpy.isEmpty());
429 EXPECT_EQ(QVariantList() << QVariant("close"), actionInvokedSpy.at(0));
430 }
431
432
433=== modified file 'tests/menus/test-menu-input-model-shortcuts.c'
434--- tests/menus/test-menu-input-model-shortcuts.c 2013-11-29 11:52:14 +0000
435+++ tests/menus/test-menu-input-model-shortcuts.c 2014-03-20 10:03:07 +0000
436@@ -45,22 +45,22 @@
437 GMenu * menu = g_menu_new();
438 GMenuItem * mi = NULL;
439
440- mi = g_menu_item_new("Save", "save");
441+ mi = g_menu_item_new("Save", "unity.save");
442 g_menu_item_set_attribute_value(mi, "accel",
443 g_variant_new_string("<Control>S"));
444 g_menu_append_item(menu, mi);
445
446- mi = g_menu_item_new("Quiter", "quiter");
447+ mi = g_menu_item_new("Quiter", "unity.quiter");
448 g_menu_item_set_attribute_value(mi, "accel",
449 g_variant_new_string("<Primary><Alt>Q"));
450 g_menu_append_item(menu, mi);
451
452- mi = g_menu_item_new("Close", "close");
453+ mi = g_menu_item_new("Close", "unity.close");
454 g_menu_item_set_attribute_value(mi, "accel",
455 g_variant_new_string("<Super>W"));
456 g_menu_append_item(menu, mi);
457
458- mi = g_menu_item_new("Nothing", "nothing");
459+ mi = g_menu_item_new("Nothing", "unity.nothing");
460 g_menu_append_item(menu, mi);
461
462 GSimpleAction *save = g_simple_action_new("save", NULL);
463
464=== modified file 'tests/unit/qtgmenu/TestQtGMenu.cpp'
465--- tests/unit/qtgmenu/TestQtGMenu.cpp 2014-03-10 13:02:45 +0000
466+++ tests/unit/qtgmenu/TestQtGMenu.cpp 2014-03-20 10:03:07 +0000
467@@ -40,7 +40,7 @@
468
469 protected:
470 TestQtGMenu()
471- : m_importer( c_service, QDBusObjectPath( c_path ), "", QDBusObjectPath( c_path ) ),
472+ : m_importer( c_service, QDBusObjectPath( c_path ), "app", QDBusObjectPath( c_path ) ),
473
474 m_items_changed_spy( &m_importer, SIGNAL( MenuItemsChanged() ) ),
475
476@@ -376,7 +376,7 @@
477
478 m_action_enabled_spy.wait();
479 EXPECT_FALSE( m_action_enabled_spy.empty() );
480- EXPECT_EQ( "new", m_action_enabled_spy.at( 0 ).at( 0 ).toString().toStdString() );
481+ EXPECT_EQ( "app.new", m_action_enabled_spy.at( 0 ).at( 0 ).toString().toStdString() );
482 EXPECT_EQ( "false", m_action_enabled_spy.at( 0 ).at( 1 ).toString().toStdString() );
483 m_action_enabled_spy.clear();
484
485@@ -384,7 +384,7 @@
486
487 m_action_enabled_spy.wait();
488 EXPECT_FALSE( m_action_enabled_spy.empty() );
489- EXPECT_EQ( "new", m_action_enabled_spy.at( 0 ).at( 0 ).toString().toStdString() );
490+ EXPECT_EQ( "app.new", m_action_enabled_spy.at( 0 ).at( 0 ).toString().toStdString() );
491 EXPECT_EQ( "true", m_action_enabled_spy.at( 0 ).at( 1 ).toString().toStdString() );
492 m_action_enabled_spy.clear();
493
494@@ -519,7 +519,7 @@
495 file_menu->actions().at( 0 )->trigger();
496 m_action_activated_spy.wait();
497
498- EXPECT_FALSE( m_action_activated_spy.empty() );
499+ ASSERT_FALSE( m_action_activated_spy.empty() );
500 EXPECT_EQ( "new", m_action_activated_spy.at( 0 ).at( 0 ).toString().toStdString() );
501 EXPECT_EQ( "", m_action_activated_spy.at( 0 ).at( 1 ).toString().toStdString() );
502 m_action_activated_spy.clear();
503@@ -527,7 +527,7 @@
504 file_menu->actions().at( 1 )->trigger();
505 m_action_activated_spy.wait();
506
507- EXPECT_FALSE( m_action_activated_spy.empty() );
508+ ASSERT_FALSE( m_action_activated_spy.empty() );
509 EXPECT_EQ( "open", m_action_activated_spy.at( 0 ).at( 0 ).toString().toStdString() );
510 EXPECT_EQ( "", m_action_activated_spy.at( 0 ).at( 1 ).toString().toStdString() );
511 m_action_activated_spy.clear();
512@@ -535,7 +535,7 @@
513 file_menu->actions().at( 3 )->trigger();
514 m_action_activated_spy.wait();
515
516- EXPECT_FALSE( m_action_activated_spy.empty() );
517+ ASSERT_FALSE( m_action_activated_spy.empty() );
518 EXPECT_EQ( "lock", m_action_activated_spy.at( 0 ).at( 0 ).toString().toStdString() );
519 EXPECT_EQ( "", m_action_activated_spy.at( 0 ).at( 1 ).toString().toStdString() );
520 m_action_activated_spy.clear();
521
522=== modified file 'tests/unit/service/Mocks.h'
523--- tests/unit/service/Mocks.h 2014-03-05 12:59:07 +0000
524+++ tests/unit/service/Mocks.h 2014-03-20 10:03:07 +0000
525@@ -114,8 +114,8 @@
526
527 MOCK_METHOD1(executeToolbar, void(const QString &));
528
529- MOCK_METHOD4(executeParameterized, QString(unsigned long long,
530- QString &, QDBusObjectPath &, QDBusObjectPath &));
531+ MOCK_METHOD5(executeParameterized, QString(unsigned long long,
532+ QString &, QString &, QDBusObjectPath &, QDBusObjectPath &));
533
534 MOCK_CONST_METHOD0(commands, QList<QStringList>());
535

Subscribers

People subscribed via source and target branches