Merge lp:~mzanetti/unity/phablet-test-sidestage into lp:unity/phablet

Proposed by Michael Zanetti
Status: Merged
Approved by: Michael Zanetti
Approved revision: no longer in the source branch.
Merged at revision: 571
Proposed branch: lp:~mzanetti/unity/phablet-test-sidestage
Merge into: lp:unity/phablet
Diff against target: 83 lines (+54/-0)
4 files modified
SideStage/SideStage.qml (+1/-0)
tests/unittests/CMakeLists.txt (+1/-0)
tests/unittests/SideStage/CMakeLists.txt (+1/-0)
tests/unittests/SideStage/tst_SideStage.qml (+51/-0)
To merge this branch: bzr merge lp:~mzanetti/unity/phablet-test-sidestage
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Andrea Cimitan (community) Approve
Michał Sawicz Needs Information
Review via email: mp+157921@code.launchpad.net

Commit message

Added a test for SideStage.

Description of the change

SideStage only adds the handle to the regular stage. The dragging in/out is handled by a revealer. All the rest of the functionality is covered by tst_Revealer and tst_Stage

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

the units.gu(2); units.gu(5) seem slightly magical, maybe it's worth it to make them properties?

review: Needs Information
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> the units.gu(2); units.gu(5) seem slightly magical, maybe it's worth it to
> make them properties?

reworked that a bit. should be more readable now

Revision history for this message
Andrea Cimitan (cimi) wrote :

> > the units.gu(2); units.gu(5) seem slightly magical, maybe it's worth it to
> > make them properties?
>
> reworked that a bit. should be more readable now

looks readable to me now, thanks

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'SideStage/SideStage.qml'
2--- SideStage/SideStage.qml 2013-02-15 18:04:59 +0000
3+++ SideStage/SideStage.qml 2013-04-10 07:46:19 +0000
4@@ -53,6 +53,7 @@
5
6 SidestageHandle {
7 id: handle
8+ objectName: "sideStageHandle"
9
10 anchors {
11 top: parent.top
12
13=== modified file 'tests/unittests/CMakeLists.txt'
14--- tests/unittests/CMakeLists.txt 2013-04-08 17:15:32 +0000
15+++ tests/unittests/CMakeLists.txt 2013-04-10 07:46:19 +0000
16@@ -4,3 +4,4 @@
17 set(qmltest_DEFAULT_PROPERTIES PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=minimal")
18
19 add_subdirectory(Components)
20+add_subdirectory(SideStage)
21
22=== added directory 'tests/unittests/SideStage'
23=== added file 'tests/unittests/SideStage/CMakeLists.txt'
24--- tests/unittests/SideStage/CMakeLists.txt 1970-01-01 00:00:00 +0000
25+++ tests/unittests/SideStage/CMakeLists.txt 2013-04-10 07:46:19 +0000
26@@ -0,0 +1,1 @@
27+add_qml_test(SideStage)
28
29=== added file 'tests/unittests/SideStage/tst_SideStage.qml'
30--- tests/unittests/SideStage/tst_SideStage.qml 1970-01-01 00:00:00 +0000
31+++ tests/unittests/SideStage/tst_SideStage.qml 2013-04-10 07:46:19 +0000
32@@ -0,0 +1,51 @@
33+/*
34+ * Copyright 2013 Canonical Ltd.
35+ *
36+ * This program is free software; you can redistribute it and/or modify
37+ * it under the terms of the GNU General Public License as published by
38+ * the Free Software Foundation; version 3.
39+ *
40+ * This program is distributed in the hope that it will be useful,
41+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
42+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43+ * GNU General Public License for more details.
44+ *
45+ * You should have received a copy of the GNU General Public License
46+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
47+ */
48+
49+import QtQuick 2.0
50+import QtTest 1.0
51+import "../../qmluitests/"
52+import "../../../SideStage"
53+import Ubuntu.Components 0.1
54+
55+UnityTestCase {
56+ name: "SideStage"
57+
58+ SideStage {
59+ id: sideStage
60+ width: units.gu(30)
61+ height: units.gu(30)
62+ handleExpanded: sideStageRevealer.pressed
63+ handleSizeCollapsed: units.gu(2)
64+ handleSizeExpanded: units.gu(5)
65+ }
66+
67+ function test_handle_data() {
68+ return [
69+ {tag: "expanded", expanded: true},
70+ {tag: "collapsed", expanded: false}
71+ ]
72+ }
73+
74+ function test_handle(data) {
75+ sideStage.handleExpanded = data.expanded
76+
77+ if (data.expanded) {
78+ tryCompare(findChild(sideStage, "sideStageHandle"), "width", sideStage.handleSizeExpanded);
79+ } else {
80+ tryCompare(findChild(sideStage, "sideStageHandle"), "width", sideStage.handleSizeCollapsed);
81+ }
82+ }
83+}

Subscribers

People subscribed via source and target branches