on xenial help sign in
Merge trunk.
dc32dd9Michał Sawicz
@@ -166,3 +166,32 @@ $ make tryDragHandle
166NB: Manual test or interation doesn't make sense for all components or classes,
166NB: Manual test or interation doesn't make sense for all components or classes,
167particularly the non-graphical ones. In such cases no "tryFoo" make target is
167particularly the non-graphical ones. In such cases no "tryFoo" make target is
168provided.
168provided.
169+
170+NB: The tests expect the locale to be the C locale, they may fail if run
171+under a different locale, if you get failures others can not reproduce
172+prepend 'LC_ALL=C' to the 'make test' command
173+
174+Running autopilot tests
175+=======================
176+
177+Autopilot tests are run from the build directory (which will be ./builddir if you used
178+the ./build script).
179+
180+$ make autopilot
181+
182+If you want you can also run tests individually, for that you need to install first,
183+otherwise the tests will run on the system-installed version
184+
185+$ make install
186+
187+To see the list of existing autopilot tests you can do
188+
189+$ PYTHONPATH=../tests/autopilot autopilot list unity8
190+
191+And then run a single test with
192+
193+$ PYTHONPATH=../tests/autopilot autopilot run unity8.some.very.long.test.name
194+
195+or run them all with
196+
197+$ PYTHONPATH=../tests/autopilot autopilot run unity8
cmake/modules/autopilot.cmake+5−1
@@ -4,7 +4,11 @@ function(declare_autopilot_test TEST_NAME TEST_SUITE WORKING_DIR)
4 add_custom_target(autopilot-${TEST_NAME}
4 add_custom_target(autopilot-${TEST_NAME}
5 COMMAND LANG=C UBUNTU_ICON_THEME=ubuntu-mobile QML2_IMPORT_PATH=${SHELL_INSTALL_QML}/mocks autopilot run ${TEST_SUITE}
5 COMMAND LANG=C UBUNTU_ICON_THEME=ubuntu-mobile QML2_IMPORT_PATH=${SHELL_INSTALL_QML}/mocks autopilot run ${TEST_SUITE}
6 WORKING_DIRECTORY ${WORKING_DIR}
6 WORKING_DIRECTORY ${WORKING_DIR}
7− DEPENDS install
7+ DEPENDS fake_install
8+ )
9+
10+ add_custom_target(fake_install
11+ COMMAND cmake --build ${CMAKE_BINARY_DIR} --target install
8 )
12 )
9
13
10 add_dependencies(autopilot autopilot-${TEST_NAME})
14 add_dependencies(autopilot autopilot-${TEST_NAME})
plugins/DashViews/horizontaljournal.cpp+2−2
@@ -172,7 +172,7 @@ void HorizontalJournal::cleanupExistingItems()
172 releaseItem(item);
172 releaseItem(item);
173 m_visibleItems.clear();
173 m_visibleItems.clear();
174 m_lastInRowIndexPosition.clear();
174 m_lastInRowIndexPosition.clear();
175− m_firstVisibleIndex = 0;
175+ m_firstVisibleIndex = -1;
176}
176}
177
177
178void HorizontalJournal::calculateImplicitHeight()
178void HorizontalJournal::calculateImplicitHeight()
@@ -241,7 +241,7 @@ void HorizontalJournal::doRelayout()
241 }
241 }
242 m_visibleItems.clear();
242 m_visibleItems.clear();
243 m_lastInRowIndexPosition.clear();
243 m_lastInRowIndexPosition.clear();
244− m_firstVisibleIndex = 0;
244+ m_firstVisibleIndex = -1;
245 }
245 }
246}
246}
247
247
qml/ScopeTool.qml+26−28
@@ -17,7 +17,9 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19import Ubuntu.Components.Popups 0.1
19import Ubuntu.Components.Popups 0.1
20+import Utils 0.1
20import Unity 0.2
21import Unity 0.2
22+import "Components"
21import "Dash"
23import "Dash"
22
24
23Rectangle {
25Rectangle {
@@ -43,18 +45,28 @@ Rectangle {
43 signal searchClicked
45 signal searchClicked
44 }
46 }
45
47
48+ SortFilterProxyModel {
49+ id: filteredScopes
50+ model: Scopes {
51+ id: scopes
52+ }
53+ dynamicSortFilter: true
46
54
47− Scopes {
55+ filterRole: Scopes.RoleVisible
48− id: scopes
56+ filterRegExp: RegExp("^true$")
49 }
57 }
50
58
51 Rectangle {
59 Rectangle {
52− anchors.fill: scopeView
60+ anchors.fill: dashContent
53 color: "#FCFCFC"
61 color: "#FCFCFC"
54 }
62 }
55
63
56− GenericScopeView {
64+ DashContent {
57− id: scopeView
65+ id: dashContent
66+
67+ model: filteredScopes
68+ searchHistory: SearchHistoryModel { }
69+ property Scope scope: scopes.get(currentIndex)
58
70
59 anchors {
71 anchors {
60 top: parent.top
72 top: parent.top
@@ -62,8 +74,6 @@ Rectangle {
62 left: parent.left
74 left: parent.left
63 right: controls.left
75 right: controls.left
64 }
76 }
65−
66− scope: scopes.loaded ? scopes.get(scopeSelector.selectedIndex) : undefined
67 }
77 }
68
78
69 Rectangle {
79 Rectangle {
@@ -76,6 +86,10 @@ Rectangle {
76 right: parent.right
86 right: parent.right
77 }
87 }
78
88
89+ MouseArea {
90+ anchors.fill: parent
91+ }
92+
79 Column {
93 Column {
80 anchors { fill: parent; margins: units.gu(1) }
94 anchors { fill: parent; margins: units.gu(1) }
81 spacing: units.gu(1)
95 spacing: units.gu(1)
@@ -88,27 +102,11 @@ Rectangle {
88 id: searchField
102 id: searchField
89 anchors { left: parent.left; right: parent.right }
103 anchors { left: parent.left; right: parent.right }
90
104
91− onTextChanged: scopeView.scope.searchQuery = text
105+ onTextChanged: dashContent.scope.searchQuery = text
92
106
93 Connections {
107 Connections {
94− target: scopeView.scope
108+ target: dashContent.scope
95− onSearchQueryChanged: searchField.text = scopeView.scope.searchQuery
109+ onSearchQueryChanged: searchField.text = dashContent.scope.searchQuery
96− }
97− }
98−
99− Label {
100− text: "Scope selection"
101− height: units.gu(4)
102− verticalAlignment: Text.AlignBottom
103− }
104−
105− OptionSelector {
106− id: scopeSelector
107− anchors { left: parent.left; right: parent.right }
108−
109− model: scopes
110− delegate: OptionSelectorDelegate {
111− text: model.title
112 }
110 }
113 }
111 }
114
112
@@ -121,7 +119,7 @@ Rectangle {
121 OptionSelector {
119 OptionSelector {
122 id: categorySelector
120 id: categorySelector
123 anchors { left: parent.left; right: parent.right }
121 anchors { left: parent.left; right: parent.right }
124− model: scopeView.scope ? scopeView.scope.categories : null
122+ model: dashContent.scope ? dashContent.scope.categories : null
125
123
126 property Item selectedItem
124 property Item selectedItem
127
125
@@ -170,7 +168,7 @@ Rectangle {
170 onCancelClicked: PopupUtils.close(sheet)
168 onCancelClicked: PopupUtils.close(sheet)
171 onConfirmClicked: {
169 onConfirmClicked: {
172 PopupUtils.close(sheet);
170 PopupUtils.close(sheet);
173− scopeView.scope.categories.overrideCategoryJson(categorySelector.selectedItem.categoryId, categoryEditorArea.text);
171+ dashContent.scope.categories.overrideCategoryJson(categorySelector.selectedItem.categoryId, categoryEditorArea.text);
174 }
172 }
175 }
173 }
176 }
174 }
src/CMakeLists.txt+9−1
@@ -5,7 +5,15 @@ include_directories(
5 ${UNITY-MIR_INCLUDE_DIRS}
5 ${UNITY-MIR_INCLUDE_DIRS}
6)
6)
7
7
8−file(GLOB_RECURSE QML_FILES ${CMAKE_SOURCE_DIR}/qml/*)
8+file(GLOB_RECURSE QML_FILES
9+ ${CMAKE_SOURCE_DIR}/qml/*
10+ ${CMAKE_SOURCE_DIR}/tests/*.qml
11+ ${CMAKE_SOURCE_DIR}/tests/*.js
12+ ${CMAKE_SOURCE_DIR}/tests/*.jpg
13+ ${CMAKE_SOURCE_DIR}/tests/*.png
14+ ${CMAKE_SOURCE_DIR}/tests/*.sci
15+ ${CMAKE_SOURCE_DIR}/tests/*.svg
16+)
9
17
10add_executable(${SHELL_APP}
18add_executable(${SHELL_APP}
11 ApplicationArguments.h
19 ApplicationArguments.h
tests/autopilot/unity8/shell/tests/__init__.py+1
@@ -147,6 +147,7 @@ class UnityTestCase(AutopilotTestCase):
147 if model() != "Desktop":
147 if model() != "Desktop":
148 from autopilot.input import _uinput
148 from autopilot.input import _uinput
149 _uinput._touch_device = _uinput.create_touch_device()
149 _uinput._touch_device = _uinput.create_touch_device()
150+ self.addCleanup(_uinput._touch_device.close)
150 ####
151 ####
151
152
152 self.touch = Touch.create()
153 self.touch = Touch.create()