Merge lp:~unity-team/unity8/scopes_more_things_on_memory into lp:unity8
- scopes_more_things_on_memory
- Merge into trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Andrea Cimitan | ||||||||
Approved revision: | 1245 | ||||||||
Merged at revision: | 1321 | ||||||||
Proposed branch: | lp:~unity-team/unity8/scopes_more_things_on_memory | ||||||||
Merge into: | lp:unity8 | ||||||||
Prerequisite: | lp:~aacid/unity8/fix_gsv_test | ||||||||
Diff against target: |
1223 lines (+458/-95) 42 files modified
build.sh (+1/-0) cmake/modules/QmlTest.cmake (+2/-1) debian/control (+1/-0) plugins/Dash/CardCreator.js (+5/-2) plugins/Dash/listviewwithpageheader.cpp (+18/-7) plugins/Dash/listviewwithpageheader.h (+6/-0) qml/Components/ResponsiveGridView.qml (+5/-1) qml/Dash/CardGrid.qml (+1/-0) qml/Dash/CardTool.qml (+8/-5) qml/Dash/CardVerticalJournal.qml (+1/-0) qml/Dash/DashContent.qml (+3/-0) qml/Dash/DashNavigation.qml (+1/-0) qml/Dash/DashRenderer.qml (+4/-0) qml/Dash/GenericScopeView.qml (+37/-14) qml/Dash/ScopeListView.qml (+1/-0) qml/Dash/ScopesOverviewAll.qml (+2/-0) tests/autopilot/unity8/shell/emulators/dash.py (+2/-2) tests/mocks/Ubuntu/CMakeLists.txt (+1/-0) tests/mocks/Ubuntu/Connectivity/CMakeLists.txt (+10/-0) tests/mocks/Ubuntu/Connectivity/networking-status.cpp (+64/-0) tests/mocks/Ubuntu/Connectivity/networking-status.h (+73/-0) tests/mocks/Ubuntu/Connectivity/plugin.cpp (+46/-0) tests/mocks/Ubuntu/Connectivity/plugin.h (+35/-0) tests/mocks/Ubuntu/Connectivity/qmldir (+2/-0) tests/plugins/Dash/CMakeLists.txt (+3/-3) tests/plugins/Dash/cardcreator/1.res (+2/-1) tests/plugins/Dash/cardcreator/2.res (+2/-1) tests/plugins/Dash/cardcreator/3.res (+3/-2) tests/plugins/Dash/cardcreator/4.res (+3/-2) tests/plugins/Dash/cardcreator/5.res (+3/-2) tests/plugins/Dash/cardcreator/7.res (+3/-2) tests/plugins/Dash/listviewwithpageheadertest.cpp (+39/-0) tests/plugins/Dash/listviewwithpageheadertest.qml (+1/-0) tests/plugins/Dash/listviewwithpageheadertestsection.qml (+1/-0) tests/plugins/Dash/listviewwithpageheadertestsectionexternalmodel.qml (+1/-0) tests/plugins/Ubuntu/Gestures/CMakeLists.txt (+1/-1) tests/qmltests/Components/CMakeLists.txt (+1/-1) tests/qmltests/Dash/tst_Card.qml (+26/-0) tests/qmltests/Dash/tst_Dash.qml (+16/-39) tests/qmltests/Dash/tst_DashContent.qml (+14/-1) tests/qmltests/Dash/tst_GenericScopeView.qml (+7/-6) tests/utils/modules/Unity/Test/UnityTestCase.qml (+3/-2) |
||||||||
To merge this branch: | bzr merge lp:~unity-team/unity8/scopes_more_things_on_memory | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrea Cimitan (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Albert Astals Cid (community) | has code of mine | Abstain | |
Review via email:
|
This proposal supersedes a proposal from 2014-09-23.
Commit message
Cache more things in memory, so flicking scopes should be faster
Description of the change
* Are there any related MPs required for this MP to build/function as expected?
No
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* Did you make sure that your branch does not contain spurious tags?
Yes
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
* If you changed the UI, has there been a design review?
N/A
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1208
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1210
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1211
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1214
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1215
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1215
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1216
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1217
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1219
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1220
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1221
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1222
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1223
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1224
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Omer Akram (om26er) wrote : Posted in a previous version of this proposal | # |
Loving this branch.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1225
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Albert Astals Cid (aacid) : Posted in a previous version of this proposal | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1226
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1227
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Albert Astals Cid (aacid) : Posted in a previous version of this proposal | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1227
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1228
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1230
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Andrea Cimitan (cimi) wrote : Posted in a previous version of this proposal | # |
Few comments
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal | # |
Answered some of your comments.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1231
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1232
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1234. By Albert Astals Cid
-
things are a bit slower to load now since we're asking for a bazillion of items to be on memory so give the tryCompareFunction some more time
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1233
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1234
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1235. By Albert Astals Cid
-
Move common waiting to the top
- 1236. By Albert Astals Cid
-
Wait for stuff to settle
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1236
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1236
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1237. By Albert Astals Cid
-
Merge
- 1238. By Albert Astals Cid
-
We also need a longer wait in here
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1237
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1238
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1239. By Albert Astals Cid
-
Does this help?
- 1240. By Albert Astals Cid
-
Dude i had fixed this :S
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1240
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 1241. By Albert Astals Cid
-
next try
- 1242. By Albert Astals Cid
-
Merge
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1242
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1243. By Albert Astals Cid
-
Mereg
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1243
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Andrea Cimitan (cimi) : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Albert Astals Cid (aacid) : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Albert Astals Cid (aacid) wrote : | # |
Fixed.
- 1244. By Albert Astals Cid
-
some minor fixes
- 1245. By Albert Astals Cid
-
Happier Cimi :)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1245
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Andrea Cimitan (cimi) wrote : | # |
* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes
* Did CI run pass? If not, please explain why.
unrelated
* Did you make sure that the branch does not contain spurious tags?
Yes
Preview Diff
1 | === modified file 'build.sh' |
2 | --- build.sh 2014-08-14 13:37:22 +0000 |
3 | +++ build.sh 2014-09-29 11:41:25 +0000 |
4 | @@ -51,6 +51,7 @@ |
5 | qtdeclarative5-ubuntu-settings-components \ |
6 | qtdeclarative5-ubuntu-telephony0.1 \ |
7 | qtdeclarative5-ubuntu-thumbnailer0.1 \ |
8 | + qml-module-ubuntu-connectivity \ |
9 | unity-notifications-impl \ |
10 | ubuntu-mobile-icons \ |
11 | unity-scope-home \ |
12 | |
13 | === modified file 'cmake/modules/QmlTest.cmake' |
14 | --- cmake/modules/QmlTest.cmake 2014-09-17 13:51:12 +0000 |
15 | +++ cmake/modules/QmlTest.cmake 2014-09-29 11:41:25 +0000 |
16 | @@ -143,7 +143,7 @@ |
17 | add_manual_qml_test(${SUBPATH} ${COMPONENT_NAME} ${ARGN}) |
18 | endmacro(add_qml_test_internal) |
19 | |
20 | -macro(add_binary_qml_test CLASS_NAME LD_PATH DEPS) |
21 | +macro(add_binary_qml_test CLASS_NAME LD_PATH DEPS ENVVAR) |
22 | set(testCommand |
23 | LD_LIBRARY_PATH=${LD_PATH} |
24 | ${CMAKE_CURRENT_BINARY_DIR}/${CLASS_NAME}TestExec |
25 | @@ -160,6 +160,7 @@ |
26 | endif() |
27 | set(xvfbtestCommand |
28 | ${LD_PRELOAD_PATH} |
29 | + ${ENVVAR} |
30 | LD_LIBRARY_PATH=${LD_PATH} |
31 | xvfb-run --server-args "-screen 0 1024x768x24" --auto-servernum |
32 | ${CMAKE_CURRENT_BINARY_DIR}/${CLASS_NAME}TestExec |
33 | |
34 | === modified file 'debian/control' |
35 | --- debian/control 2014-09-26 19:12:24 +0000 |
36 | +++ debian/control 2014-09-29 11:41:25 +0000 |
37 | @@ -174,6 +174,7 @@ |
38 | libhardware2, |
39 | unity-schemas (>= 7.3.1+14.10.20140915), |
40 | pay-service, |
41 | + qml-module-ubuntu-connectivity, |
42 | ${misc:Depends}, |
43 | ${shlibs:Depends}, |
44 | Provides: unity-launcher-impl, |
45 | |
46 | === modified file 'plugins/Dash/CardCreator.js' |
47 | --- plugins/Dash/CardCreator.js 2014-09-17 11:17:26 +0000 |
48 | +++ plugins/Dash/CardCreator.js 2014-09-29 11:41:25 +0000 |
49 | @@ -84,7 +84,8 @@ |
50 | } \n\ |
51 | image: Image { \n\ |
52 | objectName: "artImage"; \n\ |
53 | - source: cardData && cardData["art"] || ""; \n\ |
54 | + property bool doLoadSource: !NetworkingStatus.limitedBandwith; \n\ |
55 | + source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; } \n\ |
56 | cache: true; \n\ |
57 | asynchronous: root.asynchronous; \n\ |
58 | fillMode: Image.PreserveAspectCrop; \n\ |
59 | @@ -195,7 +196,8 @@ |
60 | objectName: "mascotImage"; \n\ |
61 | anchors { %1 } \n\ |
62 | readonly property int maxSize: Math.max(width, height) * 4; \n\ |
63 | - source: cardData && cardData["mascot"] || ""; \n\ |
64 | + property bool doLoadSource: !NetworkingStatus.limitedBandwith; \n\ |
65 | + source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; } \n\ |
66 | width: units.gu(6); \n\ |
67 | height: units.gu(5.625); \n\ |
68 | sourceSize { width: maxSize; height: maxSize } \n\ |
69 | @@ -655,6 +657,7 @@ |
70 | function createCardComponent(parent, template, components) { |
71 | var imports = 'import QtQuick 2.2; \n\ |
72 | import Ubuntu.Components 1.1; \n\ |
73 | + import Ubuntu.Connectivity 1.0; \n\ |
74 | import Dash 0.1;\n\ |
75 | import Utils 0.1;\n'; |
76 | var card = cardString(template, components); |
77 | |
78 | === modified file 'plugins/Dash/listviewwithpageheader.cpp' |
79 | --- plugins/Dash/listviewwithpageheader.cpp 2014-09-15 15:28:06 +0000 |
80 | +++ plugins/Dash/listviewwithpageheader.cpp 2014-09-29 11:41:25 +0000 |
81 | @@ -104,8 +104,6 @@ |
82 | #pragma GCC diagnostic pop |
83 | // #include <private/qquickrectangle_p.h> |
84 | |
85 | -static const qreal bufferRatio = 0.5; |
86 | - |
87 | qreal ListViewWithPageHeader::ListItem::height() const |
88 | { |
89 | return m_item->height() + (m_sectionItem ? m_sectionItem->height() : 0); |
90 | @@ -158,6 +156,7 @@ |
91 | , m_forceNoClip(false) |
92 | , m_inLayout(false) |
93 | , m_inContentHeightKeepHeaderShown(false) |
94 | + , m_cacheBuffer(0) |
95 | { |
96 | m_clipItem = new QQuickItem(contentItem()); |
97 | // m_clipItem = new QQuickRectangle(contentItem()); |
98 | @@ -335,6 +334,20 @@ |
99 | return m_headerItemShownHeight; |
100 | } |
101 | |
102 | +qreal ListViewWithPageHeader::cacheBuffer() const |
103 | +{ |
104 | + return m_cacheBuffer; |
105 | +} |
106 | + |
107 | +void ListViewWithPageHeader::setCacheBuffer(qreal cacheBuffer) |
108 | +{ |
109 | + if (cacheBuffer != m_cacheBuffer) { |
110 | + m_cacheBuffer = cacheBuffer; |
111 | + Q_EMIT cacheBufferChanged(); |
112 | + polish(); |
113 | + } |
114 | +} |
115 | + |
116 | void ListViewWithPageHeader::positionAtBeginning() |
117 | { |
118 | if (m_delegateModel->count() <= 0) |
119 | @@ -356,8 +369,7 @@ |
120 | // Create the subsequent items |
121 | int modelIndex = 1; |
122 | qreal pos = item->y() + item->height(); |
123 | - const qreal buffer = height() * bufferRatio; |
124 | - const qreal bufferTo = height() + buffer; |
125 | + const qreal bufferTo = height() + m_cacheBuffer; |
126 | while (modelIndex < m_delegateModel->count() && pos <= bufferTo) { |
127 | if (!(item = createItem(modelIndex, false))) |
128 | break; |
129 | @@ -603,11 +615,10 @@ |
130 | return; |
131 | } |
132 | |
133 | - const qreal buffer = height() * bufferRatio; |
134 | const qreal from = contentY(); |
135 | const qreal to = from + height(); |
136 | - const qreal bufferFrom = from - buffer; |
137 | - const qreal bufferTo = to + buffer; |
138 | + const qreal bufferFrom = from - m_cacheBuffer; |
139 | + const qreal bufferTo = to + m_cacheBuffer; |
140 | |
141 | bool added = addVisibleItems(from, to, false); |
142 | bool removed = removeNonVisibleItems(bufferFrom, bufferTo); |
143 | |
144 | === modified file 'plugins/Dash/listviewwithpageheader.h' |
145 | --- plugins/Dash/listviewwithpageheader.h 2014-09-11 15:51:55 +0000 |
146 | +++ plugins/Dash/listviewwithpageheader.h 2014-09-29 11:41:25 +0000 |
147 | @@ -54,6 +54,7 @@ |
148 | Q_PROPERTY(bool forceNoClip READ forceNoClip WRITE setForceNoClip NOTIFY forceNoClipChanged) |
149 | Q_PROPERTY(int stickyHeaderHeight READ stickyHeaderHeight NOTIFY stickyHeaderHeightChanged) |
150 | Q_PROPERTY(qreal headerItemShownHeight READ headerItemShownHeight NOTIFY headerItemShownHeightChanged) |
151 | + Q_PROPERTY(qreal cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged) |
152 | |
153 | friend class ListViewWithPageHeaderTest; |
154 | friend class ListViewWithPageHeaderTestSection; |
155 | @@ -84,6 +85,9 @@ |
156 | int stickyHeaderHeight() const; |
157 | qreal headerItemShownHeight() const; |
158 | |
159 | + qreal cacheBuffer() const; |
160 | + void setCacheBuffer(qreal cacheBuffer); |
161 | + |
162 | Q_INVOKABLE void positionAtBeginning(); |
163 | Q_INVOKABLE void showHeader(); |
164 | Q_INVOKABLE int firstCreatedIndex() const; |
165 | @@ -105,6 +109,7 @@ |
166 | void forceNoClipChanged(); |
167 | void stickyHeaderHeightChanged(); |
168 | void headerItemShownHeightChanged(); |
169 | + void cacheBufferChanged(); |
170 | |
171 | protected: |
172 | void componentComplete() override; |
173 | @@ -199,6 +204,7 @@ |
174 | bool m_forceNoClip; |
175 | bool m_inLayout; |
176 | bool m_inContentHeightKeepHeaderShown; |
177 | + qreal m_cacheBuffer; |
178 | |
179 | // Qt 5.0 doesn't like releasing the items just after itemCreated |
180 | // so we delay the releasing until the next updatePolish |
181 | |
182 | === modified file 'qml/Components/ResponsiveGridView.qml' |
183 | --- qml/Components/ResponsiveGridView.qml 2014-07-21 14:13:26 +0000 |
184 | +++ qml/Components/ResponsiveGridView.qml 2014-09-29 11:41:25 +0000 |
185 | @@ -34,7 +34,11 @@ |
186 | readonly property int cellWidth: gridView.cellWidth |
187 | readonly property int cellHeight: gridView.cellHeight |
188 | readonly property int totalContentHeight: { |
189 | - return contentHeightForRows(Math.ceil(gridView.model.count / columns), cellHeight) |
190 | + if (gridView.model) { |
191 | + return contentHeightForRows(Math.ceil(gridView.model.count / columns), cellHeight) |
192 | + } else { |
193 | + return 0; |
194 | + } |
195 | } |
196 | property alias interactive: gridView.interactive |
197 | readonly property alias flicking: gridView.flicking |
198 | |
199 | === modified file 'qml/Dash/CardGrid.qml' |
200 | --- qml/Dash/CardGrid.qml 2014-09-09 19:08:33 +0000 |
201 | +++ qml/Dash/CardGrid.qml 2014-09-29 11:41:25 +0000 |
202 | @@ -55,6 +55,7 @@ |
203 | delegate: Item { |
204 | width: grid.cellWidth |
205 | height: grid.cellHeight |
206 | + visible: y + height >= root.visibleRangeBegin && y <= root.visibleRangeEnd |
207 | Loader { |
208 | id: loader |
209 | sourceComponent: cardTool.cardComponent |
210 | |
211 | === modified file 'qml/Dash/CardTool.qml' |
212 | --- qml/Dash/CardTool.qml 2014-09-08 14:11:57 +0000 |
213 | +++ qml/Dash/CardTool.qml 2014-09-29 11:41:25 +0000 |
214 | @@ -169,16 +169,19 @@ |
215 | |
216 | Item { |
217 | id: attributesModel |
218 | - property int numOfAttributes: { |
219 | + property int numOfAttributes: 0 |
220 | + property var model: [] |
221 | + property bool hasAttributes: { |
222 | var attributes = components["attributes"]; |
223 | - if ((attributes != undefined) && attributes["field"]) { |
224 | + var hasAttributesFlag = (attributes != undefined) && attributes["field"]; |
225 | + |
226 | + if (hasAttributesFlag) { |
227 | if (attributes["max-count"]) { |
228 | - return attributes["max-count"]; |
229 | + numOfAttributes = attributes["max-count"]; |
230 | } |
231 | } |
232 | - return 0; |
233 | + return hasAttributesFlag |
234 | } |
235 | - property var model: [] |
236 | |
237 | onNumOfAttributesChanged: { |
238 | model = [] |
239 | |
240 | === modified file 'qml/Dash/CardVerticalJournal.qml' |
241 | --- qml/Dash/CardVerticalJournal.qml 2014-09-12 09:31:56 +0000 |
242 | +++ qml/Dash/CardVerticalJournal.qml 2014-09-29 11:41:25 +0000 |
243 | @@ -49,6 +49,7 @@ |
244 | id: loader |
245 | sourceComponent: cardTool.cardComponent |
246 | width: cardTool.cardWidth |
247 | + visible: y + height >= root.visibleRangeBegin && y <= root.visibleRangeEnd |
248 | onLoaded: { |
249 | item.objectName = "delegate" + index; |
250 | item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; }); |
251 | |
252 | === modified file 'qml/Dash/DashContent.qml' |
253 | --- qml/Dash/DashContent.qml 2014-08-27 15:35:52 +0000 |
254 | +++ qml/Dash/DashContent.qml 2014-09-29 11:41:25 +0000 |
255 | @@ -111,6 +111,8 @@ |
256 | highlightMoveDuration: 250 |
257 | highlightRangeMode: ListView.StrictlyEnforceRange |
258 | // TODO Investigate if we can switch to a smaller cache buffer when/if UbuntuShape gets more performant |
259 | + // 1073741823 is s^30 -1. A quite big number so that you have "infinite" cache, but not so |
260 | + // big so that if you add if with itself you're outside the 2^31 int range |
261 | cacheBuffer: 1073741823 |
262 | onMovementStarted: currentItem.item.showHeader(); |
263 | clip: parent.x != 0 |
264 | @@ -177,6 +179,7 @@ |
265 | dashContent.scopeLoaded(item.scope.id) |
266 | item.paginationCount = Qt.binding(function() { return dashContentList.count } ) |
267 | item.paginationIndex = Qt.binding(function() { return dashContentList.currentIndex } ) |
268 | + item.holdingList = dashContentList; |
269 | } |
270 | Connections { |
271 | target: isCurrent ? scope : null |
272 | |
273 | === modified file 'qml/Dash/DashNavigation.qml' |
274 | --- qml/Dash/DashNavigation.qml 2014-08-28 07:42:46 +0000 |
275 | +++ qml/Dash/DashNavigation.qml 2014-09-29 11:41:25 +0000 |
276 | @@ -52,6 +52,7 @@ |
277 | |
278 | Rectangle { |
279 | id: blackRect |
280 | + objectName: "blackRect" |
281 | color: "black" |
282 | opacity: openList && openList.currentItem && openList.currentItem.visible ? 0.5 : 0 |
283 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } |
284 | |
285 | === modified file 'qml/Dash/DashRenderer.qml' |
286 | --- qml/Dash/DashRenderer.qml 2014-09-10 07:01:34 +0000 |
287 | +++ qml/Dash/DashRenderer.qml 2014-09-29 11:41:25 +0000 |
288 | @@ -27,6 +27,10 @@ |
289 | |
290 | property int displayMarginEnd: 0 |
291 | |
292 | + property int visibleRangeBegin: 0 |
293 | + |
294 | + property int visibleRangeEnd: 0 |
295 | + |
296 | property real originY: 0 |
297 | |
298 | // The model to renderer |
299 | |
300 | === modified file 'qml/Dash/GenericScopeView.qml' |
301 | --- qml/Dash/GenericScopeView.qml 2014-09-18 21:23:55 +0000 |
302 | +++ qml/Dash/GenericScopeView.qml 2014-09-29 11:41:25 +0000 |
303 | @@ -38,6 +38,7 @@ |
304 | property int paginationCount: 0 |
305 | property int paginationIndex: 0 |
306 | property alias pageHeaderTotallyVisible: categoryView.pageHeaderTotallyVisible |
307 | + property var holdingList: null |
308 | |
309 | property var scopeStyle: ScopeStyle { |
310 | style: scope ? scope.customizations : {} |
311 | @@ -251,8 +252,8 @@ |
312 | } |
313 | } |
314 | |
315 | - onHeightChanged: rendererLoader.updateDelegateCreationRange(); |
316 | - onYChanged: rendererLoader.updateDelegateCreationRange(); |
317 | + onHeightChanged: rendererLoader.updateRanges(); |
318 | + onYChanged: rendererLoader.updateRanges(); |
319 | |
320 | Loader { |
321 | id: rendererLoader |
322 | @@ -314,7 +315,7 @@ |
323 | var shouldExpand = baseItem.category === categoryView.expandedCategoryId; |
324 | baseItem.expand(shouldExpand, false /*animate*/); |
325 | } |
326 | - updateDelegateCreationRange(); |
327 | + updateRanges(); |
328 | if (scope && scope.id === "clickscope" && (categoryId === "predefined" || categoryId === "local")) { |
329 | // Yeah, hackish :/ |
330 | cardTool.artShapeSize = Qt.size(units.gu(8), units.gu(7.5)); |
331 | @@ -348,13 +349,25 @@ |
332 | } |
333 | Connections { |
334 | target: categoryView |
335 | - onOriginYChanged: rendererLoader.updateDelegateCreationRange(); |
336 | - onContentYChanged: rendererLoader.updateDelegateCreationRange(); |
337 | - onHeightChanged: rendererLoader.updateDelegateCreationRange(); |
338 | - onContentHeightChanged: rendererLoader.updateDelegateCreationRange(); |
339 | - } |
340 | - |
341 | - function updateDelegateCreationRange() { |
342 | + onOriginYChanged: rendererLoader.updateRanges(); |
343 | + onContentYChanged: rendererLoader.updateRanges(); |
344 | + onHeightChanged: rendererLoader.updateRanges(); |
345 | + onContentHeightChanged: rendererLoader.updateRanges(); |
346 | + } |
347 | + Connections { |
348 | + target: scopeView |
349 | + onIsCurrentChanged: rendererLoader.updateRanges(); |
350 | + } |
351 | + Connections { |
352 | + target: holdingList |
353 | + onMovingChanged: if (!moving) rendererLoader.updateRanges(); |
354 | + } |
355 | + |
356 | + function updateRanges() { |
357 | + if (holdingList && holdingList.moving) { |
358 | + return; |
359 | + } |
360 | + |
361 | if (categoryView.moving) { |
362 | // Do not update the range if we are overshooting up or down, since we'll come back |
363 | // to the stable position and delete/create items without any reason |
364 | @@ -366,10 +379,20 @@ |
365 | } |
366 | } |
367 | |
368 | + if (item && item.hasOwnProperty("visibleRangeBegin")) { |
369 | + item.visibleRangeBegin = Math.max(-baseItem.y, 0) |
370 | + item.visibleRangeEnd = item.visibleRangeBegin + Math.min(categoryView.height, rendererLoader.height) |
371 | + } |
372 | + |
373 | if (item && item.hasOwnProperty("displayMarginBeginning")) { |
374 | // TODO do we need item.originY here, test 1300302 once we have a silo |
375 | // and we can run it on the phone |
376 | - if (baseItem.y + baseItem.height <= 0) { |
377 | + if (scopeView.isCurrent) { |
378 | + // 1073741823 is s^30 -1. A quite big number so that you have "infinite" display margin, but not so |
379 | + // big so that if you add if with itself you're outside the 2^31 int range |
380 | + item.displayMarginBeginning = 1073741823; |
381 | + item.displayMarginEnd = 1073741823; |
382 | + } else if (baseItem.y + baseItem.height <= 0) { |
383 | // Not visible (item at top of the list viewport) |
384 | item.displayMarginBeginning = -baseItem.height; |
385 | item.displayMarginEnd = 0; |
386 | @@ -378,9 +401,9 @@ |
387 | item.displayMarginBeginning = 0; |
388 | item.displayMarginEnd = -baseItem.height; |
389 | } else { |
390 | - item.displayMarginBeginning = -Math.max(-baseItem.y, 0); |
391 | - item.displayMarginEnd = -Math.max(baseItem.height - seeAll.height |
392 | - - categoryView.height + baseItem.y, 0) |
393 | + item.displayMarginBeginning = Math.round(-Math.max(-baseItem.y, 0)); |
394 | + item.displayMarginEnd = -Math.round(Math.max(baseItem.height - seeAll.height - |
395 | + categoryView.height + baseItem.y, 0)); |
396 | } |
397 | } |
398 | } |
399 | |
400 | === modified file 'qml/Dash/ScopeListView.qml' |
401 | --- qml/Dash/ScopeListView.qml 2014-07-23 06:54:10 +0000 |
402 | +++ qml/Dash/ScopeListView.qml 2014-09-29 11:41:25 +0000 |
403 | @@ -20,4 +20,5 @@ |
404 | ListViewWithPageHeader { |
405 | maximumFlickVelocity: height * 10 |
406 | flickDeceleration: height * 2 |
407 | + cacheBuffer: Number.MAX_VALUE |
408 | } |
409 | |
410 | === modified file 'qml/Dash/ScopesOverviewAll.qml' |
411 | --- qml/Dash/ScopesOverviewAll.qml 2014-09-18 05:15:18 +0000 |
412 | +++ qml/Dash/ScopesOverviewAll.qml 2014-09-29 11:41:25 +0000 |
413 | @@ -43,6 +43,8 @@ |
414 | id: cardGrid |
415 | width: root.width |
416 | height: parent.height |
417 | + visibleRangeBegin: root.contentY |
418 | + visibleRangeEnd: root.contentY + root.height |
419 | |
420 | onClicked: { |
421 | root.clicked(index, result, item, itemModel); |
422 | |
423 | === modified file 'tests/autopilot/unity8/shell/emulators/dash.py' |
424 | --- tests/autopilot/unity8/shell/emulators/dash.py 2014-08-25 16:07:45 +0000 |
425 | +++ tests/autopilot/unity8/shell/emulators/dash.py 2014-09-29 11:41:25 +0000 |
426 | @@ -93,7 +93,7 @@ |
427 | 'No scope found with id {0}'.format(scope_id)) |
428 | |
429 | def _get_scope_from_loader(self, loader): |
430 | - return loader.get_children()[0] |
431 | + return loader.wait_select_single('GenericScopeView'); |
432 | |
433 | def _open_scope_scrolling(self, scope_loader): |
434 | scroll = self._get_scroll_direction(scope_loader) |
435 | @@ -102,8 +102,8 @@ |
436 | scroll() |
437 | self.dash_content_list.moving.wait_for(False) |
438 | |
439 | + scope_loader.isCurrent.wait_for(True) |
440 | scope = self._get_scope_from_loader(scope_loader) |
441 | - scope.isCurrent.wait_for(True) |
442 | return scope |
443 | |
444 | def _get_scroll_direction(self, scope_loader): |
445 | |
446 | === modified file 'tests/mocks/Ubuntu/CMakeLists.txt' |
447 | --- tests/mocks/Ubuntu/CMakeLists.txt 2014-08-25 10:05:13 +0000 |
448 | +++ tests/mocks/Ubuntu/CMakeLists.txt 2014-09-29 11:41:25 +0000 |
449 | @@ -1,3 +1,4 @@ |
450 | +add_subdirectory(Connectivity) |
451 | add_subdirectory(DownloadDaemonListener) |
452 | add_subdirectory(Payments) |
453 | add_subdirectory(SystemImage) |
454 | |
455 | === added directory 'tests/mocks/Ubuntu/Connectivity' |
456 | === added file 'tests/mocks/Ubuntu/Connectivity/CMakeLists.txt' |
457 | --- tests/mocks/Ubuntu/Connectivity/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
458 | +++ tests/mocks/Ubuntu/Connectivity/CMakeLists.txt 2014-09-29 11:41:25 +0000 |
459 | @@ -0,0 +1,10 @@ |
460 | +add_library(connectivity-qml SHARED |
461 | + networking-status.cpp |
462 | + plugin.cpp |
463 | +) |
464 | +qt5_use_modules(connectivity-qml Qml) |
465 | + |
466 | +# copy qmldir file into build directory for shadow builds |
467 | +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir" |
468 | + DESTINATION ${CMAKE_CURRENT_BINARY_DIR} |
469 | + ) |
470 | |
471 | === added file 'tests/mocks/Ubuntu/Connectivity/networking-status.cpp' |
472 | --- tests/mocks/Ubuntu/Connectivity/networking-status.cpp 1970-01-01 00:00:00 +0000 |
473 | +++ tests/mocks/Ubuntu/Connectivity/networking-status.cpp 2014-09-29 11:41:25 +0000 |
474 | @@ -0,0 +1,64 @@ |
475 | +/* |
476 | + * Copyright © 2014 Canonical Ltd. |
477 | + * |
478 | + * This program is free software: you can redistribute it and/or modify it |
479 | + * under the terms of the GNU Lesser General Public License version 3, |
480 | + * as published by the Free Software Foundation. |
481 | + * |
482 | + * This program is distributed in the hope that it will be useful, |
483 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
484 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
485 | + * GNU Lesser General Public License for more details. |
486 | + * |
487 | + * You should have received a copy of the GNU Lesser General Public License |
488 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
489 | + * |
490 | + * Authors: |
491 | + * Antti Kaijanmäki <antti.kaijanmaki@canonical.com> |
492 | + */ |
493 | + |
494 | +#include "networking-status.h" |
495 | + |
496 | +NetworkingStatus::NetworkingStatus(QObject *parent) |
497 | + : QObject(parent) |
498 | +{ |
499 | + qRegisterMetaType<NetworkingStatus::Limitations>(); |
500 | + qRegisterMetaType<QVector<NetworkingStatus::Limitations>>(); |
501 | + qRegisterMetaType<NetworkingStatus::Status>(); |
502 | +} |
503 | + |
504 | +NetworkingStatus::~NetworkingStatus() |
505 | +{} |
506 | + |
507 | +QVector<NetworkingStatus::Limitations> |
508 | +NetworkingStatus::limitations() const |
509 | +{ |
510 | + return m_limitations; |
511 | +} |
512 | + |
513 | +NetworkingStatus::Status |
514 | +NetworkingStatus::status() const |
515 | +{ |
516 | + return Status::Online; |
517 | +} |
518 | + |
519 | +bool |
520 | +NetworkingStatus::online() const |
521 | +{ |
522 | + return status() == Status::Online; |
523 | +} |
524 | + |
525 | +bool |
526 | +NetworkingStatus::limitedBandwith() const |
527 | +{ |
528 | + return limitations().contains(Limitations::Bandwith); |
529 | +} |
530 | + |
531 | +void NetworkingStatus::setLimitedBandwidth(bool limited) |
532 | +{ |
533 | + if (limited) { |
534 | + m_limitations << Limitations::Bandwith; |
535 | + } else if (limitedBandwith()) { |
536 | + m_limitations.remove(m_limitations.indexOf(Limitations::Bandwith)); |
537 | + } |
538 | +} |
539 | |
540 | === added file 'tests/mocks/Ubuntu/Connectivity/networking-status.h' |
541 | --- tests/mocks/Ubuntu/Connectivity/networking-status.h 1970-01-01 00:00:00 +0000 |
542 | +++ tests/mocks/Ubuntu/Connectivity/networking-status.h 2014-09-29 11:41:25 +0000 |
543 | @@ -0,0 +1,73 @@ |
544 | +/* |
545 | + * Copyright © 2014 Canonical Ltd. |
546 | + * |
547 | + * This program is free software: you can redistribute it and/or modify it |
548 | + * under the terms of the GNU Lesser General Public License version 3, |
549 | + * as published by the Free Software Foundation. |
550 | + * |
551 | + * This program is distributed in the hope that it will be useful, |
552 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
553 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
554 | + * GNU Lesser General Public License for more details. |
555 | + * |
556 | + * You should have received a copy of the GNU Lesser General Public License |
557 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
558 | + * |
559 | + */ |
560 | + |
561 | +#ifndef FAKE_NETWORKING_STATUS_H |
562 | +#define FAKE_NETWORKING_STATUS_H |
563 | + |
564 | +#include <QObject> |
565 | +#include <QVector> |
566 | + |
567 | +class Q_DECL_EXPORT NetworkingStatus : public QObject |
568 | +{ |
569 | + Q_OBJECT |
570 | + Q_DISABLE_COPY(NetworkingStatus) |
571 | + |
572 | + Q_ENUMS(Limitations) |
573 | + Q_ENUMS(Status) |
574 | + |
575 | + Q_PROPERTY(QVector<Limitations> limitations READ limitations NOTIFY limitationsChanged) |
576 | + Q_PROPERTY(Status status READ status NOTIFY statusChanged) |
577 | + Q_PROPERTY(bool online READ online NOTIFY onlineChanged) |
578 | + Q_PROPERTY(bool limitedBandwith READ limitedBandwith WRITE setLimitedBandwidth NOTIFY limitedBandwithChanged) |
579 | + |
580 | +public: |
581 | + explicit NetworkingStatus(QObject *parent = 0); |
582 | + virtual ~NetworkingStatus(); |
583 | + |
584 | + enum Limitations { |
585 | + Bandwith |
586 | + }; |
587 | + |
588 | + enum Status { |
589 | + Offline, |
590 | + Connecting, |
591 | + Online |
592 | + }; |
593 | + |
594 | + QVector<Limitations> limitations() const; |
595 | + Status status() const; |
596 | + bool online() const; |
597 | + bool limitedBandwith() const; |
598 | + |
599 | + // Only in the fake one |
600 | + void setLimitedBandwidth(bool limited); |
601 | + |
602 | +Q_SIGNALS: |
603 | + void limitationsChanged(); |
604 | + void statusChanged(Status value); |
605 | + void onlineChanged(bool value); |
606 | + void limitedBandwithChanged(bool value); |
607 | + |
608 | +private: |
609 | + QVector<NetworkingStatus::Limitations> m_limitations; |
610 | +}; |
611 | + |
612 | +Q_DECLARE_METATYPE(NetworkingStatus::Limitations) |
613 | +Q_DECLARE_METATYPE(QVector<NetworkingStatus::Limitations>) |
614 | +Q_DECLARE_METATYPE(NetworkingStatus::Status) |
615 | + |
616 | +#endif // FAKE_NETWORKING_STATUS_H |
617 | |
618 | === added file 'tests/mocks/Ubuntu/Connectivity/plugin.cpp' |
619 | --- tests/mocks/Ubuntu/Connectivity/plugin.cpp 1970-01-01 00:00:00 +0000 |
620 | +++ tests/mocks/Ubuntu/Connectivity/plugin.cpp 2014-09-29 11:41:25 +0000 |
621 | @@ -0,0 +1,46 @@ |
622 | +/* |
623 | + * Copyright © 2014 Canonical Ltd. |
624 | + * |
625 | + * This program is free software: you can redistribute it and/or modify it |
626 | + * under the terms of the GNU Lesser General Public License version 3, |
627 | + * as published by the Free Software Foundation. |
628 | + * |
629 | + * This program is distributed in the hope that it will be useful, |
630 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
631 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
632 | + * GNU Lesser General Public License for more details. |
633 | + * |
634 | + * You should have received a copy of the GNU Lesser General Public License |
635 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
636 | + * |
637 | + * Authors: |
638 | + * Antti Kaijanmäki <antti.kaijanmaki@canonical.com> |
639 | + */ |
640 | + |
641 | +#include "plugin.h" |
642 | + |
643 | +#include <QtQml> |
644 | + |
645 | +#include "networking-status.h" |
646 | + |
647 | +static QObject * |
648 | +networkingStatusSingletonProvider(QQmlEngine *engine, QJSEngine *scriptEngine) |
649 | +{ |
650 | + Q_UNUSED(scriptEngine) |
651 | + |
652 | + return new NetworkingStatus(engine); |
653 | +} |
654 | + |
655 | +void |
656 | +QmlConnectivityNetworkingPlugin::registerTypes(const char *uri) |
657 | +{ |
658 | + // @uri Ubuntu.Connectivity |
659 | + qmlRegisterSingletonType<NetworkingStatus>(uri, 1, 0, "NetworkingStatus", networkingStatusSingletonProvider); |
660 | +} |
661 | + |
662 | +void |
663 | +QmlConnectivityNetworkingPlugin::initializeEngine(QQmlEngine *engine, const char *uri) |
664 | +{ |
665 | + Q_UNUSED(uri); |
666 | + Q_UNUSED(engine); |
667 | +} |
668 | |
669 | === added file 'tests/mocks/Ubuntu/Connectivity/plugin.h' |
670 | --- tests/mocks/Ubuntu/Connectivity/plugin.h 1970-01-01 00:00:00 +0000 |
671 | +++ tests/mocks/Ubuntu/Connectivity/plugin.h 2014-09-29 11:41:25 +0000 |
672 | @@ -0,0 +1,35 @@ |
673 | +/* |
674 | + * Copyright © 2014 Canonical Ltd. |
675 | + * |
676 | + * This program is free software: you can redistribute it and/or modify it |
677 | + * under the terms of the GNU Lesser General Public License version 3, |
678 | + * as published by the Free Software Foundation. |
679 | + * |
680 | + * This program is distributed in the hope that it will be useful, |
681 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
682 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
683 | + * GNU Lesser General Public License for more details. |
684 | + * |
685 | + * You should have received a copy of the GNU Lesser General Public License |
686 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
687 | + * |
688 | + * Authors: |
689 | + * Antti Kaijanmäki <antti.kaijanmaki@canonical.com> |
690 | + */ |
691 | + |
692 | +#ifndef QML_CONNECTIVITY_PLUGIN_H |
693 | +#define QML_CONNECTIVITY_PLUGIN_H |
694 | + |
695 | +#include <QQmlExtensionPlugin> |
696 | + |
697 | +class QmlConnectivityNetworkingPlugin : public QQmlExtensionPlugin { |
698 | + Q_OBJECT |
699 | + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") |
700 | + Q_INTERFACES(QQmlExtensionInterface) |
701 | + |
702 | +public: |
703 | + void registerTypes(const char *uri); |
704 | + void initializeEngine(QQmlEngine *engine, const char *uri); |
705 | +}; |
706 | + |
707 | +#endif // QML_CONNECTIVITY_PLUGIN_H |
708 | |
709 | === added file 'tests/mocks/Ubuntu/Connectivity/qmldir' |
710 | --- tests/mocks/Ubuntu/Connectivity/qmldir 1970-01-01 00:00:00 +0000 |
711 | +++ tests/mocks/Ubuntu/Connectivity/qmldir 2014-09-29 11:41:25 +0000 |
712 | @@ -0,0 +1,2 @@ |
713 | +module Ubuntu.Connectivity |
714 | +plugin connectivity-qml |
715 | |
716 | === modified file 'tests/plugins/Dash/CMakeLists.txt' |
717 | --- tests/plugins/Dash/CMakeLists.txt 2014-07-22 10:03:37 +0000 |
718 | +++ tests/plugins/Dash/CMakeLists.txt 2014-09-29 11:41:25 +0000 |
719 | @@ -32,7 +32,7 @@ |
720 | qt5_use_modules(${TESTNAME}TestExec Test Core Qml) |
721 | target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES}) |
722 | |
723 | - add_binary_qml_test(${TESTNAME} "" "Dash-qml") |
724 | + add_binary_qml_test(${TESTNAME} "" "Dash-qml" "") |
725 | endmacro() |
726 | |
727 | add_lvwph_test(listviewwithpageheader ListViewWithPageHeader) |
728 | @@ -48,7 +48,7 @@ |
729 | qt5_use_modules(${TESTNAME}TestExec Test Core Qml) |
730 | target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES}) |
731 | |
732 | - add_binary_qml_test(${TESTNAME} "" "Dash-qml") |
733 | + add_binary_qml_test(${TESTNAME} "" "Dash-qml" "") |
734 | |
735 | add_executable(${TESTNAME}tryExec |
736 | ${FILENAME}try.cpp |
737 | @@ -71,7 +71,7 @@ |
738 | add_executable(CardCreatorTestExec cardcreatortest.cpp) |
739 | qt5_use_modules(CardCreatorTestExec Test Core Qml) |
740 | target_link_libraries(CardCreatorTestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES}) |
741 | -add_binary_qml_test(CardCreator "" "Dash-qml") |
742 | +add_binary_qml_test(CardCreator "" "Dash-qml" "QML2_IMPORT_PATH=${CMAKE_BINARY_DIR}/tests/mocks/") |
743 | |
744 | # plain qml test |
745 | set(qmltest_DEFAULT_TARGETS qmluitests) |
746 | |
747 | === modified file 'tests/plugins/Dash/cardcreator/1.res' |
748 | --- tests/plugins/Dash/cardcreator/1.res 2014-09-17 14:17:21 +0000 |
749 | +++ tests/plugins/Dash/cardcreator/1.res 2014-09-29 11:41:25 +0000 |
750 | @@ -46,7 +46,8 @@ |
751 | } |
752 | image: Image { |
753 | objectName: "artImage"; |
754 | - source: cardData && cardData["art"] || ""; |
755 | + property bool doLoadSource: !NetworkingStatus.limitedBandwith; |
756 | + source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; } |
757 | cache: true; |
758 | asynchronous: root.asynchronous; |
759 | fillMode: Image.PreserveAspectCrop; |
760 | |
761 | === modified file 'tests/plugins/Dash/cardcreator/2.res' |
762 | --- tests/plugins/Dash/cardcreator/2.res 2014-08-29 08:31:22 +0000 |
763 | +++ tests/plugins/Dash/cardcreator/2.res 2014-09-29 11:41:25 +0000 |
764 | @@ -67,7 +67,8 @@ |
765 | objectName: "mascotImage"; |
766 | anchors { verticalCenter: parent.verticalCenter; } |
767 | readonly property int maxSize: Math.max(width, height) * 4; |
768 | - source: cardData && cardData["mascot"] || ""; |
769 | + property bool doLoadSource: !NetworkingStatus.limitedBandwith; |
770 | + source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; } |
771 | width: units.gu(6); |
772 | height: units.gu(5.625); |
773 | sourceSize { width: maxSize; height: maxSize } |
774 | |
775 | === modified file 'tests/plugins/Dash/cardcreator/3.res' |
776 | --- tests/plugins/Dash/cardcreator/3.res 2014-09-17 14:17:21 +0000 |
777 | +++ tests/plugins/Dash/cardcreator/3.res 2014-09-29 11:41:25 +0000 |
778 | @@ -46,8 +46,9 @@ |
779 | } |
780 | image: Image { |
781 | objectName: "artImage"; |
782 | - source: cardData && cardData["art"] || ""; |
783 | - cache: true; |
784 | + property bool doLoadSource: !NetworkingStatus.limitedBandwith; |
785 | + source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; } |
786 | + cache: true; |
787 | asynchronous: root.asynchronous; |
788 | fillMode: Image.PreserveAspectCrop; |
789 | width: root.width; |
790 | |
791 | === modified file 'tests/plugins/Dash/cardcreator/4.res' |
792 | --- tests/plugins/Dash/cardcreator/4.res 2014-08-13 10:29:21 +0000 |
793 | +++ tests/plugins/Dash/cardcreator/4.res 2014-09-29 11:41:25 +0000 |
794 | @@ -46,8 +46,9 @@ |
795 | objectName: "mascotImage"; |
796 | anchors { verticalCenter: parent.verticalCenter; } |
797 | readonly property int maxSize: Math.max(width, height) * 4; |
798 | - source: cardData && cardData["mascot"] || ""; |
799 | - width: units.gu(6); |
800 | + property bool doLoadSource: !NetworkingStatus.limitedBandwith; |
801 | + source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; } |
802 | + width: units.gu(6); |
803 | height: units.gu(5.625); |
804 | sourceSize { width: maxSize; height: maxSize } |
805 | fillMode: Image.PreserveAspectCrop; |
806 | |
807 | === modified file 'tests/plugins/Dash/cardcreator/5.res' |
808 | --- tests/plugins/Dash/cardcreator/5.res 2014-09-17 14:17:21 +0000 |
809 | +++ tests/plugins/Dash/cardcreator/5.res 2014-09-29 11:41:25 +0000 |
810 | @@ -46,8 +46,9 @@ |
811 | } |
812 | image: Image { |
813 | objectName: "artImage"; |
814 | - source: cardData && cardData["art"] || ""; |
815 | - cache: true; |
816 | + property bool doLoadSource: !NetworkingStatus.limitedBandwith; |
817 | + source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; } |
818 | + cache: true; |
819 | asynchronous: root.asynchronous; |
820 | fillMode: Image.PreserveAspectCrop; |
821 | width: root.width; |
822 | |
823 | === modified file 'tests/plugins/Dash/cardcreator/7.res' |
824 | --- tests/plugins/Dash/cardcreator/7.res 2014-08-29 08:31:22 +0000 |
825 | +++ tests/plugins/Dash/cardcreator/7.res 2014-09-29 11:41:25 +0000 |
826 | @@ -67,8 +67,9 @@ |
827 | objectName: "mascotImage"; |
828 | anchors { verticalCenter: parent.verticalCenter; } |
829 | readonly property int maxSize: Math.max(width, height) * 4; |
830 | - source: cardData && cardData["mascot"] || ""; |
831 | - width: units.gu(6); |
832 | + property bool doLoadSource: !NetworkingStatus.limitedBandwith; |
833 | + source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; } |
834 | + width: units.gu(6); |
835 | height: units.gu(5.625); |
836 | sourceSize { width: maxSize; height: maxSize } |
837 | fillMode: Image.PreserveAspectCrop; |
838 | |
839 | === modified file 'tests/plugins/Dash/listviewwithpageheadertest.cpp' |
840 | --- tests/plugins/Dash/listviewwithpageheadertest.cpp 2014-04-24 14:13:21 +0000 |
841 | +++ tests/plugins/Dash/listviewwithpageheadertest.cpp 2014-09-29 11:41:25 +0000 |
842 | @@ -28,6 +28,8 @@ |
843 | #include <private/qquickitem_p.h> |
844 | #pragma GCC diagnostic pop |
845 | |
846 | +#include <limits> |
847 | + |
848 | // TODO Think on how doing a test for lost items |
849 | // particullary making sure that lost items are culled |
850 | // and then removed in the next updatePolish cycle |
851 | @@ -1899,6 +1901,43 @@ |
852 | QTRY_COMPARE(lvwph->m_firstVisibleIndex, 0); |
853 | } |
854 | |
855 | + void testNoCacheBuffer() |
856 | + { |
857 | + lvwph->setCacheBuffer(0); |
858 | + QTRY_COMPARE(lvwph->m_visibleItems.count(), 3); |
859 | + QCOMPARE(lvwph->m_firstVisibleIndex, 0); |
860 | + verifyItem(0, 50., 150., false); |
861 | + verifyItem(1, 200., 200., false); |
862 | + verifyItem(2, 400., 350., false); |
863 | + QCOMPARE(lvwph->m_minYExtent, 0.); |
864 | + QCOMPARE(lvwph->m_clipItem->y(), 0.); |
865 | + QCOMPARE(lvwph->m_clipItem->clip(), false); |
866 | + QCOMPARE(lvwph->m_headerItem->y(), 0.); |
867 | + QCOMPARE(lvwph->m_headerItem->height(), 50.); |
868 | + QCOMPARE(lvwph->contentY(), 0.); |
869 | + QCOMPARE(lvwph->m_headerItemShownHeight, 0.); |
870 | + } |
871 | + |
872 | + void testAllCacheBuffer() |
873 | + { |
874 | + lvwph->setCacheBuffer(std::numeric_limits<qreal>::max()); |
875 | + QTRY_COMPARE(lvwph->m_visibleItems.count(), 6); |
876 | + QCOMPARE(lvwph->m_firstVisibleIndex, 0); |
877 | + verifyItem(0, 50., 150., false); |
878 | + verifyItem(1, 200., 200., false); |
879 | + verifyItem(2, 400., 350., false); |
880 | + verifyItem(3, 750., 350., true); |
881 | + verifyItem(4, 1100., 350., true); |
882 | + verifyItem(5, 1450., 350., true); |
883 | + QCOMPARE(lvwph->m_minYExtent, 0.); |
884 | + QCOMPARE(lvwph->m_clipItem->y(), 0.); |
885 | + QCOMPARE(lvwph->m_clipItem->clip(), false); |
886 | + QCOMPARE(lvwph->m_headerItem->y(), 0.); |
887 | + QCOMPARE(lvwph->m_headerItem->height(), 50.); |
888 | + QCOMPARE(lvwph->contentY(), 0.); |
889 | + QCOMPARE(lvwph->m_headerItemShownHeight, 0.); |
890 | + } |
891 | + |
892 | private: |
893 | QQuickView *view; |
894 | ListViewWithPageHeader *lvwph; |
895 | |
896 | === modified file 'tests/plugins/Dash/listviewwithpageheadertest.qml' |
897 | --- tests/plugins/Dash/listviewwithpageheadertest.qml 2014-04-30 10:06:33 +0000 |
898 | +++ tests/plugins/Dash/listviewwithpageheadertest.qml 2014-09-29 11:41:25 +0000 |
899 | @@ -60,6 +60,7 @@ |
900 | anchors.top: parent.top |
901 | anchors.bottom: parent.bottom |
902 | model: model |
903 | + cacheBuffer: height * 0.5 |
904 | delegate: Rectangle { |
905 | property bool timerDone: false |
906 | width: parent.width - 20 |
907 | |
908 | === modified file 'tests/plugins/Dash/listviewwithpageheadertestsection.qml' |
909 | --- tests/plugins/Dash/listviewwithpageheadertestsection.qml 2014-04-30 10:06:33 +0000 |
910 | +++ tests/plugins/Dash/listviewwithpageheadertestsection.qml 2014-09-29 11:41:25 +0000 |
911 | @@ -60,6 +60,7 @@ |
912 | anchors.top: parent.top |
913 | anchors.bottom: parent.bottom |
914 | model: model |
915 | + cacheBuffer: height * 0.5 |
916 | delegate: Rectangle { |
917 | property bool timerDone: false |
918 | width: parent.width - 20 |
919 | |
920 | === modified file 'tests/plugins/Dash/listviewwithpageheadertestsectionexternalmodel.qml' |
921 | --- tests/plugins/Dash/listviewwithpageheadertestsectionexternalmodel.qml 2014-04-30 10:06:33 +0000 |
922 | +++ tests/plugins/Dash/listviewwithpageheadertestsectionexternalmodel.qml 2014-09-29 11:41:25 +0000 |
923 | @@ -28,6 +28,7 @@ |
924 | anchors.top: parent.top |
925 | anchors.bottom: parent.bottom |
926 | model: model |
927 | + cacheBuffer: height * 0.5 |
928 | delegate: Rectangle { |
929 | property bool timerDone: false |
930 | width: parent.width - 20 |
931 | |
932 | === modified file 'tests/plugins/Ubuntu/Gestures/CMakeLists.txt' |
933 | --- tests/plugins/Ubuntu/Gestures/CMakeLists.txt 2014-05-01 14:25:18 +0000 |
934 | +++ tests/plugins/Ubuntu/Gestures/CMakeLists.txt 2014-09-29 11:41:25 +0000 |
935 | @@ -19,7 +19,7 @@ |
936 | qt5_use_modules(${CLASSNAME}TestExec Test Core Qml Gui Quick) |
937 | target_link_libraries(${CLASSNAME}TestExec UbuntuGestureQml) |
938 | |
939 | - add_binary_qml_test(${CLASSNAME} ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures UbuntuGesturesTestQmlFiles) |
940 | + add_binary_qml_test(${CLASSNAME} ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures UbuntuGesturesTestQmlFiles "") |
941 | add_manual_qml_test(. ${CLASSNAME} IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins) |
942 | endmacro(add_gesture_ui_test) |
943 | |
944 | |
945 | === modified file 'tests/qmltests/Components/CMakeLists.txt' |
946 | --- tests/qmltests/Components/CMakeLists.txt 2014-05-01 14:25:18 +0000 |
947 | +++ tests/qmltests/Components/CMakeLists.txt 2014-09-29 11:41:25 +0000 |
948 | @@ -10,7 +10,7 @@ |
949 | qt5_use_modules(DragHandleTestExec Test Core Qml Gui Quick) |
950 | target_link_libraries(DragHandleTestExec UbuntuGestureQml) |
951 | |
952 | -add_binary_qml_test(DragHandle ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures "") |
953 | +add_binary_qml_test(DragHandle ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures "" "") |
954 | add_manual_qml_test(. DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins) |
955 | |
956 | add_definitions(-DUBUNTU_GESTURES_PLUGIN_DIR="${CMAKE_BINARY_DIR}/plugins") |
957 | |
958 | === modified file 'tests/qmltests/Dash/tst_Card.qml' |
959 | --- tests/qmltests/Dash/tst_Card.qml 2014-09-04 15:44:48 +0000 |
960 | +++ tests/qmltests/Dash/tst_Card.qml 2014-09-29 11:41:25 +0000 |
961 | @@ -17,6 +17,7 @@ |
962 | import QtQuick 2.0 |
963 | import QtTest 1.0 |
964 | import Ubuntu.Components 0.1 |
965 | +import Ubuntu.Connectivity 1.0 |
966 | import Unity.Test 0.1 as UT |
967 | import "../../../qml/Dash" |
968 | import "CardHelpers.js" as Helpers |
969 | @@ -205,6 +206,11 @@ |
970 | property Item backgroundImage: findChild(card, "backgroundImage") |
971 | property Item mascotImage: findChild(card, "mascotImage"); |
972 | |
973 | + function init() { |
974 | + loader.visible = true; |
975 | + NetworkingStatus.limitedBandwith = false; |
976 | + } |
977 | + |
978 | function cleanup() { |
979 | selector.selectedIndex = -1; |
980 | } |
981 | @@ -566,5 +572,25 @@ |
982 | verify((card.width - titleToCard.x - titleToCard.width) === units.gu(1)); |
983 | } |
984 | } |
985 | + |
986 | + function test_load_images_visibility_network_data() { |
987 | + return [ |
988 | + { tag: "Visible, network", visible: true, limitedBandwith: false }, |
989 | + { tag: "Visible, no network", visible: true, limitedBandwith: true }, |
990 | + { tag: "Not Visible, network", visible: false, limitedBandwith: false }, |
991 | + { tag: "Not Visible, no network", visible: false, limitedBandwith: true } |
992 | + ]; |
993 | + } |
994 | + |
995 | + function test_load_images_visibility_network(data) { |
996 | + loader.visible = data.visible; |
997 | + NetworkingStatus.limitedBandwith = data.limitedBandwith; |
998 | + |
999 | + selector.selectedIndex = 0; |
1000 | + waitForRendering(selector); |
1001 | + waitForRendering(card); |
1002 | + |
1003 | + verify(data.visible || !data.limitedBandwith || artImage.source == ""); |
1004 | + } |
1005 | } |
1006 | } |
1007 | |
1008 | === modified file 'tests/qmltests/Dash/tst_Dash.qml' |
1009 | --- tests/qmltests/Dash/tst_Dash.qml 2014-09-08 14:14:12 +0000 |
1010 | +++ tests/qmltests/Dash/tst_Dash.qml 2014-09-29 11:41:25 +0000 |
1011 | @@ -55,6 +55,16 @@ |
1012 | scopes.load(); |
1013 | tryCompare(dashContentList, "currentIndex", 0); |
1014 | tryCompare(dashContentList, "count", 6); |
1015 | + tryCompare(scopes, "loaded", true); |
1016 | + tryCompareFunction(function() { |
1017 | + var mockScope1Loader = findChild(dash, "MockScope1 loader"); |
1018 | + return mockScope1Loader && mockScope1Loader.item != null; }, |
1019 | + true, 15000); |
1020 | + tryCompareFunction(function() { |
1021 | + var mockScope1Loader = findChild(dash, "MockScope1 loader"); |
1022 | + return mockScope1Loader && mockScope1Loader.status === Loader.Ready; }, |
1023 | + true, 15000); |
1024 | + waitForRendering(findChild(dash, "MockScope1 loader").item); |
1025 | } |
1026 | |
1027 | function get_scope_data() { |
1028 | @@ -92,15 +102,6 @@ |
1029 | } |
1030 | |
1031 | function test_dash_overview_show_select_same_favorite() { |
1032 | - // Wait for stuff to be loaded |
1033 | - tryCompare(scopes, "loaded", true); |
1034 | - var dashContentList = findChild(dash, "dashContentList"); |
1035 | - tryCompare(dashContentList, "count", 6); |
1036 | - tryCompareFunction(function() { |
1037 | - var mockScope1Loader = findChild(dash, "MockScope1 loader"); |
1038 | - return mockScope1Loader && mockScope1Loader.item != null; }, |
1039 | - true); |
1040 | - |
1041 | // Show the overview |
1042 | touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18)); |
1043 | var overviewController = findInvisibleChild(dash, "overviewController"); |
1044 | @@ -121,18 +122,12 @@ |
1045 | |
1046 | // Make sure animation went back |
1047 | tryCompare(overviewController, "progress", 0); |
1048 | + |
1049 | + var dashContentList = findChild(dash, "dashContentList"); |
1050 | compare(dashContentList.currentIndex, 0); |
1051 | } |
1052 | |
1053 | function test_dash_overview_show_select_different_favorite() { |
1054 | - // Wait for stuff to be loaded |
1055 | - tryCompare(scopes, "loaded", true); |
1056 | - var dashContentList = findChild(dash, "dashContentList"); |
1057 | - tryCompare(dashContentList, "count", 6); |
1058 | - tryCompareFunction(function() { return findChild(dash, "MockScope1 loader") != null; }, true); |
1059 | - var mockScope1Loader = findChild(dash, "MockScope1 loader"); |
1060 | - tryCompare(mockScope1Loader, "status", Loader.Ready); |
1061 | - |
1062 | // Show the overview |
1063 | touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18)); |
1064 | var overviewController = findInvisibleChild(dash, "overviewController"); |
1065 | @@ -153,19 +148,11 @@ |
1066 | |
1067 | // Make sure animation went back |
1068 | tryCompare(overviewController, "progress", 0); |
1069 | + var dashContentList = findChild(dash, "dashContentList"); |
1070 | compare(dashContentList.currentIndex, 1); |
1071 | } |
1072 | |
1073 | function test_dash_overview_all_temp_scope_done_from_all() { |
1074 | - // Wait for stuff to be loaded |
1075 | - tryCompare(scopes, "loaded", true); |
1076 | - var dashContentList = findChild(dash, "dashContentList"); |
1077 | - tryCompare(dashContentList, "count", 6); |
1078 | - tryCompareFunction(function() { |
1079 | - var mockScope1Loader = findChild(dash, "MockScope1 loader"); |
1080 | - return mockScope1Loader && mockScope1Loader.item != null; }, |
1081 | - true); |
1082 | - |
1083 | // Show the overview |
1084 | touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18)); |
1085 | var overviewController = findInvisibleChild(dash, "overviewController"); |
1086 | @@ -227,20 +214,13 @@ |
1087 | tryCompare(overviewController, "progress", 0); |
1088 | |
1089 | // Original list is still on 0 |
1090 | + var dashContentList = findChild(dash, "dashContentList"); |
1091 | compare(dashContentList.currentIndex, 0); |
1092 | } |
1093 | |
1094 | function test_temp_scope_dash_overview_all_search_temp_scope_favorite_from_all() { |
1095 | - // Wait for stuff to be loaded |
1096 | - tryCompare(scopes, "loaded", true); |
1097 | - var dashContentList = findChild(dash, "dashContentList"); |
1098 | - tryCompare(dashContentList, "count", 6); |
1099 | - tryCompareFunction(function() { |
1100 | - var mockScope1Loader = findChild(dash, "MockScope1 loader"); |
1101 | - return mockScope1Loader && mockScope1Loader.item != null; }, |
1102 | - true); |
1103 | - |
1104 | // Swipe right to Apps scope |
1105 | + var dashContentList = findChild(dash, "dashContentList"); |
1106 | touchFlick(dash, dash.width - 1, units.gu(1), dash.width - units.gu(10), units.gu(1)); |
1107 | tryCompare(dashContentList, "contentX", dashContentList.width); |
1108 | tryCompare(dashContentList, "currentIndex", 1); |
1109 | @@ -249,8 +229,7 @@ |
1110 | var categoryListView = findChild(dashContentList.currentItem, "categoryListView"); |
1111 | var dashCategory2 = findChild(categoryListView, "dashCategory2"); |
1112 | tryCompareFunction(function() { |
1113 | - var d = findChild(dashCategory2, "delegate2"); |
1114 | - if (d) return true; |
1115 | + if (dashCategory2.y < 200) return true; |
1116 | categoryListView.contentY += 100; |
1117 | return false; |
1118 | }, true); |
1119 | @@ -340,8 +319,6 @@ |
1120 | } |
1121 | |
1122 | function test_processing_indicator() { |
1123 | - tryCompare(scopes, "loaded", true); |
1124 | - |
1125 | var processingIndicator = findChild(dash, "processingIndicator"); |
1126 | verify(processingIndicator, "Can't find the processing indicator."); |
1127 | |
1128 | |
1129 | === modified file 'tests/qmltests/Dash/tst_DashContent.qml' |
1130 | --- tests/qmltests/Dash/tst_DashContent.qml 2014-08-27 07:09:39 +0000 |
1131 | +++ tests/qmltests/Dash/tst_DashContent.qml 2014-09-29 11:41:25 +0000 |
1132 | @@ -70,7 +70,17 @@ |
1133 | function loadScopes() { |
1134 | scopeLoadedSpy.clear(); |
1135 | scopesModel.load(); |
1136 | - tryCompare(scopeLoadedSpy, "count", 6); |
1137 | + tryCompare(scopeLoadedSpy, "count", 6, 15000); |
1138 | + tryCompare(scopesModel, "loaded", true); |
1139 | + tryCompareFunction(function() { |
1140 | + var mockScope1Loader = findChild(shell, "MockScope1 loader"); |
1141 | + return mockScope1Loader && mockScope1Loader.item != null; }, |
1142 | + true, 15000); |
1143 | + tryCompareFunction(function() { |
1144 | + var mockScope1Loader = findChild(shell, "MockScope1 loader"); |
1145 | + return mockScope1Loader && mockScope1Loader.status === Loader.Ready; }, |
1146 | + true, 15000); |
1147 | + waitForRendering(findChild(shell, "MockScope1 loader").item); |
1148 | } |
1149 | |
1150 | function init() { |
1151 | @@ -467,6 +477,9 @@ |
1152 | var navigationListView = findChild(dashAltNavigationButton, "navigationListView"); |
1153 | tryCompare(navigationListView.currentItem.navigation, "loaded", true); |
1154 | |
1155 | + var blackRect = findChild(dashNavigation, "blackRect"); |
1156 | + tryCompare(blackRect, "opacity", 0.5); |
1157 | + |
1158 | mouseClick(dashNavigation, dashNavigationButton.x, 0); |
1159 | compare(dashNavigationButton.showList, false); |
1160 | compare(dashAltNavigationButton.showList, false); |
1161 | |
1162 | === modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml' |
1163 | --- tests/qmltests/Dash/tst_GenericScopeView.qml 2014-09-23 08:56:29 +0000 |
1164 | +++ tests/qmltests/Dash/tst_GenericScopeView.qml 2014-09-29 11:41:25 +0000 |
1165 | @@ -82,18 +82,19 @@ |
1166 | spy.signalName = ""; |
1167 | } |
1168 | |
1169 | - function scrollToCategory(category) { |
1170 | + function scrollToCategory(categoryName) { |
1171 | var categoryListView = findChild(genericScopeView, "categoryListView"); |
1172 | tryCompareFunction(function() { |
1173 | - if (findChild(genericScopeView, category)) return true; |
1174 | + var category = findChild(genericScopeView, categoryName); |
1175 | + if (category && category.y > 0 && category.y < genericScopeView.height) return true; |
1176 | mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height, |
1177 | genericScopeView.width/2, genericScopeView.y) |
1178 | tryCompare(categoryListView, "moving", false); |
1179 | - return findChild(genericScopeView, category) !== null; |
1180 | + return false; |
1181 | }, true); |
1182 | |
1183 | tryCompareFunction(function() { return findChild(genericScopeView, "delegate0") !== null; }, true); |
1184 | - return findChild(genericScopeView, category); |
1185 | + return findChild(genericScopeView, categoryName); |
1186 | } |
1187 | |
1188 | function scrollToEnd() |
1189 | @@ -283,7 +284,7 @@ |
1190 | if (category === undefined) category = 0; |
1191 | if (delegate === undefined) delegate = 0; |
1192 | tryCompareFunction(function() { |
1193 | - var cardGrid = findChild(genericScopeView, category); |
1194 | + var cardGrid = findChild(genericScopeView, "dashCategory"+category); |
1195 | if (cardGrid != null) { |
1196 | var tile = findChild(cardGrid, "delegate"+delegate); |
1197 | return tile != null; |
1198 | @@ -291,7 +292,7 @@ |
1199 | return false; |
1200 | }, |
1201 | true); |
1202 | - var tile = findChild(findChild(genericScopeView, category), "delegate"+delegate); |
1203 | + var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate); |
1204 | mouseClick(tile, tile.width / 2, tile.height / 2); |
1205 | tryCompare(testCase.subPageLoader, "open", true); |
1206 | tryCompare(testCase.subPageLoader, "x", 0); |
1207 | |
1208 | === modified file 'tests/utils/modules/Unity/Test/UnityTestCase.qml' |
1209 | --- tests/utils/modules/Unity/Test/UnityTestCase.qml 2014-08-08 11:23:57 +0000 |
1210 | +++ tests/utils/modules/Unity/Test/UnityTestCase.qml 2014-09-29 11:41:25 +0000 |
1211 | @@ -178,9 +178,10 @@ |
1212 | // Keeps executing a given parameter-less function until it returns the given |
1213 | // expected result or the timemout is reached (in which case a test failure |
1214 | // is generated) |
1215 | - function tryCompareFunction(func, expectedResult) { |
1216 | + function tryCompareFunction(func, expectedResult, timeout) { |
1217 | var timeSpent = 0 |
1218 | - var timeout = 5000 |
1219 | + if (timeout === undefined) |
1220 | + timeout = 5000; |
1221 | var success = false |
1222 | var actualResult |
1223 | while (timeSpent < timeout && !success) { |
FAILED: Continuous integration, rev:1206 jenkins. qa.ubuntu. com/job/ unity8- ci/4092/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/4037 jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- utopic/ 1093 jenkins. qa.ubuntu. com/job/ unity8- utopic- amd64-ci/ 1186 jenkins. qa.ubuntu. com/job/ unity8- utopic- i386-ci/ 1186 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/3874 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/5289 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/5289/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 12107
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/4092/ rebuild
http://