Merge lp:~ci-train-staging-area/gmenuharness/testing-train-please-ignore into lp:~ci-train-staging-area/gmenuharness/trunk-copy-please-ignore

Proposed by Robert Bruce Park on 2016-06-15
Status: Merged
Merged at revision: 24
Proposed branch: lp:~ci-train-staging-area/gmenuharness/testing-train-please-ignore
Merge into: lp:~ci-train-staging-area/gmenuharness/trunk-copy-please-ignore
Diff against target: 223 lines (+104/-2)
8 files modified
debian/changelog (+6/-0)
debian/libgmenuharness0.1.vivid.symbols (+1/-0)
debian/libgmenuharness0.1.xenial.symbols (+1/-0)
debian/libgmenuharness0.1.yakkety.symbols (+68/-0)
include/unity/gmenuharness/MenuItemMatcher.h (+2/-0)
src/MenuItemMatcher.cpp (+21/-0)
tests/functional/FunctionalTests.cpp (+2/-0)
tests/functional/menus/Deeper.cpp (+3/-2)
To merge this branch: bzr merge lp:~ci-train-staging-area/gmenuharness/testing-train-please-ignore
Reviewer Review Type Date Requested Status
CI Train Staging PPAs 2016-06-15 Pending
Review via email: mp+297461@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-11-19 11:12:21 +0000
3+++ debian/changelog 2016-06-15 13:12:23 +0000
4@@ -1,3 +1,9 @@
5+gmenuharness (0.1.1-0ubuntu1) UNRELEASED; urgency=medium
6+
7+ * add MenuItemMatcher::enabled()
8+
9+ -- Antti Kaijanmäki <antti.kaijanmaki@canonical.com> Wed, 01 Jun 2016 13:41:50 +0300
10+
11 gmenuharness (0.1+16.04.20151119.3-0ubuntu1) xenial; urgency=medium
12
13 * Add a very basic level of functional testing
14
15=== modified file 'debian/libgmenuharness0.1.vivid.symbols'
16--- debian/libgmenuharness0.1.vivid.symbols 2015-11-18 09:21:52 +0000
17+++ debian/libgmenuharness0.1.vivid.symbols 2016-06-15 13:12:23 +0000
18@@ -19,6 +19,7 @@
19 (c++)"unity::gmenuharness::MenuItemMatcher::boolean_attribute(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)@Base" 0.1+16.04.20151118
20 (c++)"unity::gmenuharness::MenuItemMatcher::checkbox()@Base" 0.1+16.04.20151118
21 (c++)"unity::gmenuharness::MenuItemMatcher::double_attribute(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double)@Base" 0.1+16.04.20151118
22+ (c++)"unity::gmenuharness::MenuItemMatcher::enabled(bool)@Base" 0replaceme
23 (c++)"unity::gmenuharness::MenuItemMatcher::has_exactly(unsigned int)@Base" 0.1+16.04.20151118
24 (c++)"unity::gmenuharness::MenuItemMatcher::icon(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.1+16.04.20151118
25 (c++)"unity::gmenuharness::MenuItemMatcher::int32_attribute(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)@Base" 0.1+16.04.20151118
26
27=== modified file 'debian/libgmenuharness0.1.xenial.symbols'
28--- debian/libgmenuharness0.1.xenial.symbols 2015-11-18 09:21:52 +0000
29+++ debian/libgmenuharness0.1.xenial.symbols 2016-06-15 13:12:23 +0000
30@@ -19,6 +19,7 @@
31 (c++)"unity::gmenuharness::MenuItemMatcher::boolean_attribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)@Base" 0.1+16.04.20151118
32 (c++)"unity::gmenuharness::MenuItemMatcher::checkbox()@Base" 0.1+16.04.20151118
33 (c++)"unity::gmenuharness::MenuItemMatcher::double_attribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double)@Base" 0.1+16.04.20151118
34+ (c++)"unity::gmenuharness::MenuItemMatcher::enabled(bool)@Base" 0replaceme
35 (c++)"unity::gmenuharness::MenuItemMatcher::has_exactly(unsigned int)@Base" 0.1+16.04.20151118
36 (c++)"unity::gmenuharness::MenuItemMatcher::icon(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.1+16.04.20151118
37 (c++)"unity::gmenuharness::MenuItemMatcher::int32_attribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)@Base" 0.1+16.04.20151118
38
39=== added file 'debian/libgmenuharness0.1.yakkety.symbols'
40--- debian/libgmenuharness0.1.yakkety.symbols 1970-01-01 00:00:00 +0000
41+++ debian/libgmenuharness0.1.yakkety.symbols 2016-06-15 13:12:23 +0000
42@@ -0,0 +1,68 @@
43+libgmenuharness.so.0.1 libgmenuharness0.1 #MINVER#
44+ (c++)"unity::gmenuharness::g_object_deleter(void*)@Base" 0.1+16.04.20151118
45+ (c++)"unity::gmenuharness::gvariant_deleter(_GVariant*)@Base" 0.1+16.04.20151118
46+ (c++)"unity::gmenuharness::MatchResult::concat_failures[abi:cxx11]() const@Base" 0.1+16.04.20151118
47+ (c++)"unity::gmenuharness::MatchResult::createChild() const@Base" 0.1+16.04.20151118
48+ (c++)"unity::gmenuharness::MatchResult::failure(std::vector<unsigned int, std::allocator<unsigned int> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.1+16.04.20151118
49+ (c++)"unity::gmenuharness::MatchResult::hasTimedOut() const@Base" 0.1+16.04.20151118
50+ (c++)"unity::gmenuharness::MatchResult::MatchResult()@Base" 0.1+16.04.20151118
51+ (c++)"unity::gmenuharness::MatchResult::MatchResult(unity::gmenuharness::MatchResult&&)@Base" 0.1+16.04.20151118
52+ (c++)"unity::gmenuharness::MatchResult::MatchResult(unity::gmenuharness::MatchResult const&)@Base" 0.1+16.04.20151118
53+ (c++)"unity::gmenuharness::MatchResult::merge(unity::gmenuharness::MatchResult const&)@Base" 0.1+16.04.20151118
54+ (c++)"unity::gmenuharness::MatchResult::operator=(unity::gmenuharness::MatchResult&&)@Base" 0.1+16.04.20151118
55+ (c++)"unity::gmenuharness::MatchResult::operator=(unity::gmenuharness::MatchResult const&)@Base" 0.1+16.04.20151118
56+ (c++)"unity::gmenuharness::MatchResult::success() const@Base" 0.1+16.04.20151118
57+ (c++)"unity::gmenuharness::MenuItemMatcher::action(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.1+16.04.20151118
58+ (c++)"unity::gmenuharness::MenuItemMatcher::activate(std::shared_ptr<_GVariant> const&)@Base" 0.1+16.04.20151118
59+ (c++)"unity::gmenuharness::MenuItemMatcher::attribute_not_set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.1+16.04.20151118
60+ (c++)"unity::gmenuharness::MenuItemMatcher::attribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<_GVariant> const&)@Base" 0.1+16.04.20151118
61+ (c++)"unity::gmenuharness::MenuItemMatcher::boolean_attribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)@Base" 0.1+16.04.20151118
62+ (c++)"unity::gmenuharness::MenuItemMatcher::checkbox()@Base" 0.1+16.04.20151118
63+ (c++)"unity::gmenuharness::MenuItemMatcher::double_attribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double)@Base" 0.1+16.04.20151118
64+ (c++)"unity::gmenuharness::MenuItemMatcher::enabled(bool)@Base" 0replaceme
65+ (c++)"unity::gmenuharness::MenuItemMatcher::has_exactly(unsigned int)@Base" 0.1+16.04.20151118
66+ (c++)"unity::gmenuharness::MenuItemMatcher::icon(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.1+16.04.20151118
67+ (c++)"unity::gmenuharness::MenuItemMatcher::int32_attribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)@Base" 0.1+16.04.20151118
68+ (c++)"unity::gmenuharness::MenuItemMatcher::int64_attribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)@Base" 0.1+16.04.20151118
69+ (c++)"unity::gmenuharness::MenuItemMatcher::is_empty()@Base" 0.1+16.04.20151118
70+ (c++)"unity::gmenuharness::MenuItemMatcher::item(unity::gmenuharness::MenuItemMatcher&&)@Base" 0.1+16.04.20151118
71+ (c++)"unity::gmenuharness::MenuItemMatcher::item(unity::gmenuharness::MenuItemMatcher const&)@Base" 0.1+16.04.20151118
72+ (c++)"unity::gmenuharness::MenuItemMatcher::label(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.1+16.04.20151118
73+ (c++)"unity::gmenuharness::MenuItemMatcher::match(unity::gmenuharness::MatchResult&, std::vector<unsigned int, std::allocator<unsigned int> > const&, std::shared_ptr<_GMenuModel> const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<_GActionGroup>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::shared_ptr<_GActionGroup> > > >&, unsigned int) const@Base" 0.1+16.04.20151118
74+ (c++)"unity::gmenuharness::MenuItemMatcher::~MenuItemMatcher()@Base" 0.1+16.04.20151118
75+ (c++)"unity::gmenuharness::MenuItemMatcher::MenuItemMatcher()@Base" 0.1+16.04.20151118
76+ (c++)"unity::gmenuharness::MenuItemMatcher::MenuItemMatcher(unity::gmenuharness::MenuItemMatcher&&)@Base" 0.1+16.04.20151118
77+ (c++)"unity::gmenuharness::MenuItemMatcher::MenuItemMatcher(unity::gmenuharness::MenuItemMatcher const&)@Base" 0.1+16.04.20151118
78+ (c++)"unity::gmenuharness::MenuItemMatcher::mode(unity::gmenuharness::MenuItemMatcher::Mode)@Base" 0.1+16.04.20151118
79+ (c++)"unity::gmenuharness::MenuItemMatcher::operator=(unity::gmenuharness::MenuItemMatcher&&)@Base" 0.1+16.04.20151118
80+ (c++)"unity::gmenuharness::MenuItemMatcher::operator=(unity::gmenuharness::MenuItemMatcher const&)@Base" 0.1+16.04.20151118
81+ (c++)"unity::gmenuharness::MenuItemMatcher::pass_through_activate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<_GVariant> const&)@Base" 0.1+16.04.20151118
82+ (c++)"unity::gmenuharness::MenuItemMatcher::pass_through_attribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<_GVariant> const&)@Base" 0.1+16.04.20151118
83+ (c++)"unity::gmenuharness::MenuItemMatcher::pass_through_boolean_attribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)@Base" 0.1+16.04.20151118
84+ (c++)"unity::gmenuharness::MenuItemMatcher::pass_through_double_attribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double)@Base" 0.1+16.04.20151118
85+ (c++)"unity::gmenuharness::MenuItemMatcher::pass_through_string_attribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.1+16.04.20151118
86+ (c++)"unity::gmenuharness::MenuItemMatcher::radio()@Base" 0.1+16.04.20151118
87+ (c++)"unity::gmenuharness::MenuItemMatcher::round_doubles(double)@Base" 0.1+16.04.20151118
88+ (c++)"unity::gmenuharness::MenuItemMatcher::section()@Base" 0.1+16.04.20151118
89+ (c++)"unity::gmenuharness::MenuItemMatcher::set_action_state(std::shared_ptr<_GVariant> const&)@Base" 0.1+16.04.20151118
90+ (c++)"unity::gmenuharness::MenuItemMatcher::set_pass_through_action_state(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<_GVariant> const&)@Base" 0.1+16.04.20151118
91+ (c++)"unity::gmenuharness::MenuItemMatcher::state_icons(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)@Base" 0.1+16.04.20151118
92+ (c++)"unity::gmenuharness::MenuItemMatcher::string_attribute(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.1+16.04.20151118
93+ (c++)"unity::gmenuharness::MenuItemMatcher::submenu()@Base" 0.1+16.04.20151118
94+ (c++)"unity::gmenuharness::MenuItemMatcher::themed_icon(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)@Base" 0.1+16.04.20151118
95+ (c++)"unity::gmenuharness::MenuItemMatcher::toggled(bool)@Base" 0.1+16.04.20151118
96+ (c++)"unity::gmenuharness::MenuItemMatcher::type(unity::gmenuharness::MenuItemMatcher::Type)@Base" 0.1+16.04.20151118
97+ (c++)"unity::gmenuharness::MenuItemMatcher::widget(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.1+16.04.20151118
98+ (c++)"unity::gmenuharness::MenuMatcher::item(unity::gmenuharness::MenuItemMatcher const&)@Base" 0.1+16.04.20151118
99+ (c++)"unity::gmenuharness::MenuMatcher::match() const@Base" 0.1+16.04.20151118
100+ (c++)"unity::gmenuharness::MenuMatcher::match(unity::gmenuharness::MatchResult&) const@Base" 0.1+16.04.20151118
101+ (c++)"unity::gmenuharness::MenuMatcher::~MenuMatcher()@Base" 0.1+16.04.20151118
102+ (c++)"unity::gmenuharness::MenuMatcher::MenuMatcher(unity::gmenuharness::MenuMatcher::Parameters const&)@Base" 0.1+16.04.20151118
103+ (c++)"unity::gmenuharness::MenuMatcher::Parameters::operator=(unity::gmenuharness::MenuMatcher::Parameters&&)@Base" 0.1+16.04.20151118
104+ (c++)"unity::gmenuharness::MenuMatcher::Parameters::operator=(unity::gmenuharness::MenuMatcher::Parameters const&)@Base" 0.1+16.04.20151118
105+ (c++)"unity::gmenuharness::MenuMatcher::Parameters::~Parameters()@Base" 0.1+16.04.20151118
106+ (c++)"unity::gmenuharness::MenuMatcher::Parameters::Parameters(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 0.1+16.04.20151118
107+ (c++)"unity::gmenuharness::MenuMatcher::Parameters::Parameters(unity::gmenuharness::MenuMatcher::Parameters&&)@Base" 0.1+16.04.20151118
108+ (c++)"unity::gmenuharness::MenuMatcher::Parameters::Parameters(unity::gmenuharness::MenuMatcher::Parameters const&)@Base" 0.1+16.04.20151118
109+ (c++)"unity::gmenuharness::menuWaitForItems(std::shared_ptr<_GMenuModel> const&, unsigned int)@Base" 0.1+16.04.20151118
110+ (c++)"unity::gmenuharness::waitForCore(_GObject*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)@Base" 0.1+16.04.20151118
111
112=== modified file 'include/unity/gmenuharness/MenuItemMatcher.h'
113--- include/unity/gmenuharness/MenuItemMatcher.h 2015-11-16 09:53:10 +0000
114+++ include/unity/gmenuharness/MenuItemMatcher.h 2016-06-15 13:12:23 +0000
115@@ -105,6 +105,8 @@
116
117 MenuItemMatcher& toggled(bool toggled);
118
119+ MenuItemMatcher& enabled(bool enabled);
120+
121 MenuItemMatcher& mode(Mode mode);
122
123 MenuItemMatcher& submenu();
124
125=== modified file 'src/MenuItemMatcher.cpp'
126--- src/MenuItemMatcher.cpp 2015-11-16 09:53:10 +0000
127+++ src/MenuItemMatcher.cpp 2016-06-15 13:12:23 +0000
128@@ -197,6 +197,8 @@
129
130 shared_ptr<bool> m_isToggled;
131
132+ shared_ptr<bool> m_isEnabled;
133+
134 vector<MenuItemMatcher> m_items;
135
136 vector<pair<string, shared_ptr<GVariant>>> m_activations;
137@@ -254,6 +256,7 @@
138 p->m_not_exist_attributes = other.p->m_not_exist_attributes;
139 p->m_pass_through_attributes = other.p->m_pass_through_attributes;
140 p->m_isToggled = other.p->m_isToggled;
141+ p->m_isEnabled = other.p->m_isEnabled;
142 p->m_linkType = other.p->m_linkType;
143 p->m_items = other.p->m_items;
144 p->m_activations = other.p->m_activations;
145@@ -403,6 +406,12 @@
146 return *this;
147 }
148
149+MenuItemMatcher& MenuItemMatcher::enabled(bool isEnabled)
150+{
151+ p->m_isEnabled = make_shared<bool>(isEnabled);
152+ return *this;
153+}
154+
155 MenuItemMatcher& MenuItemMatcher::submenu()
156 {
157 p->m_linkType = LinkType::submenu;
158@@ -485,6 +494,7 @@
159 bool isCheckbox = false;
160 bool isRadio = false;
161 bool isToggled = false;
162+ bool isEnabled = true;
163
164 pair<string, string> idPair;
165 shared_ptr<GActionGroup> actionGroup;
166@@ -510,6 +520,9 @@
167 isToggled = g_variant_get_boolean(state.get());
168 isCheckbox = true;
169 }
170+
171+ isEnabled = g_action_group_get_action_enabled(actionGroup.get(),
172+ idPair.second.c_str()) == TRUE;
173 }
174
175 Type actualType = Type::plain;
176@@ -809,6 +822,14 @@
177 + ", but found " + bool_to_string(isToggled));
178 }
179
180+ if (p->m_isEnabled && (*p->m_isEnabled) != isEnabled)
181+ {
182+ matchResult.failure(
183+ location,
184+ "Expected enabled = " + bool_to_string(*p->m_isEnabled)
185+ + ", but found " + bool_to_string(isEnabled));
186+ }
187+
188 if (!matchResult.success())
189 {
190 return;
191
192=== modified file 'tests/functional/FunctionalTests.cpp'
193--- tests/functional/FunctionalTests.cpp 2015-11-19 09:20:43 +0000
194+++ tests/functional/FunctionalTests.cpp 2016-06-15 13:12:23 +0000
195@@ -130,10 +130,12 @@
196 .item(mh::MenuItemMatcher()
197 .label("Save")
198 .action("app.save")
199+ .enabled(false)
200 )
201 .item(mh::MenuItemMatcher()
202 .label("Quit")
203 .action("app.quit")
204+ .enabled(true)
205 )
206 )
207 .item(mh::MenuItemMatcher()
208
209=== modified file 'tests/functional/menus/Deeper.cpp'
210--- tests/functional/menus/Deeper.cpp 2015-11-19 09:20:43 +0000
211+++ tests/functional/menus/Deeper.cpp 2016-06-15 13:12:23 +0000
212@@ -106,8 +106,9 @@
213 {
214 shared_ptr<GMenuItem> item(g_menu_item_new("Save", "app.save"), &g_object_deleter);
215 g_menu_append_item(fileMenu.get(), item.get());
216- g_action_map_add_action(G_ACTION_MAP(ag.get()),
217- G_ACTION(g_simple_action_new("save", NULL)));
218+ shared_ptr<GSimpleAction> action(g_simple_action_new("save", NULL), &g_object_deleter);
219+ g_simple_action_set_enabled(action.get(), FALSE);
220+ g_action_map_add_action(G_ACTION_MAP(ag.get()), G_ACTION(action.get()));
221 }
222 {
223 shared_ptr<GMenuItem> item(g_menu_item_new("Quit", "app.quit"), &g_object_deleter);

Subscribers

People subscribed via source and target branches

to all changes: