Merge lp:~paulliu/unity8/fix-zoomableimage-test1 into lp:unity8

Proposed by Ying-Chun Liu
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 886
Merged at revision: 918
Proposed branch: lp:~paulliu/unity8/fix-zoomableimage-test1
Merge into: lp:unity8
Diff against target: 134 lines (+31/-27)
2 files modified
tests/qmltests/Components/tst_ZoomableImage.qml (+21/-19)
tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml (+10/-8)
To merge this branch: bzr merge lp:~paulliu/unity8/fix-zoomableimage-test1
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Michał Sawicz Needs Fixing
Review via email: mp+218649@code.launchpad.net

Commit message

Fix ZoomableImage test failure.

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

 * 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

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
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) wrote :
review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

It's failing for me locally

tsdgeos_work@xps:~/phablet/unity8/fix-zoomableimage-test1/builddir$ make xvfbtestZoomableImage
Xlib: extension "RANDR" missing on display ":99".
********* Start testing of qmltestrunner *********
Config: Using QtTest library 5.3.0, Qt 5.3.0
PASS : qmltestrunner::ZoomableImageTest::initTestCase()
PASS : qmltestrunner::ZoomableImageTest::test_loadImage()
QWARN : qmltestrunner::ZoomableImageTest::test_mousewheel() file:///home/tsdgeos_work/phablet/unity8/fix-zoomableimage-test1/qml/Components/LazyImage.qml:118:9: QML State: Binding loop detected for property "when"
QWARN : qmltestrunner::ZoomableImageTest::test_mousewheel() file:///home/tsdgeos_work/phablet/unity8/fix-zoomableimage-test1/qml/Components/LazyImage.qml:118:9: QML State: Binding loop detected for property "when"
QWARN : qmltestrunner::ZoomableImageTest::test_mousewheel() file:///home/tsdgeos_work/phablet/unity8/fix-zoomableimage-test1/qml/Components/LazyImage.qml:118:9: QML State: Binding loop detected for property "when"
QWARN : qmltestrunner::ZoomableImageTest::test_mousewheel() file:///home/tsdgeos_work/phablet/unity8/fix-zoomableimage-test1/qml/Components/LazyImage.qml:118:9: QML State: Binding loop detected for property "when"
PASS : qmltestrunner::ZoomableImageTest::test_mousewheel()
PASS : qmltestrunner::ZoomableImageTest::test_pinch(row 0)
FAIL! : qmltestrunner::ZoomableImageTest::test_pinch(row 1) property scale
   Actual (): 0.9373503718221556
   Expected (): 0.8870230941024013
   Loc: [/home/tsdgeos_work/phablet/unity8/fix-zoomableimage-test1/tests/qmltests/Components/tst_ZoomableImage.qml(177)]
PASS : qmltestrunner::ZoomableImageTest::cleanupTestCase()
Totals: 5 passed, 1 failed, 0 skipped

review: Needs Fixing
Revision history for this message
Michał Sawicz (saviq) wrote :

PreviewZoomableImage fails, too - please fix in this same MP:

********* Start testing of qmltestrunner *********
Config: Using QtTest library 5.2.1, Qt 5.2.1
PASS : qmltestrunner::PreviewZoomableImageTest::initTestCase()
FAIL! : qmltestrunner::PreviewZoomableImageTest::test_loadImage() property imageState
   Actual (): default
   Expected (): ready
   Loc: [/home/michal/dev/canonical/unity8/repo/tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml(56)]
PASS : qmltestrunner::PreviewZoomableImageTest::cleanupTestCase()
Totals: 2 passed, 1 failed, 0 skipped
********* Finished testing of qmltestrunner *********

review: Needs Fixing
884. By Ying-Chun Liu

Merge trunk
[ Michal Hruby ]
* Updated scope tool to create proper config files after recent
  libunity-scopes-api changes.
[ Michał Sawicz ]
* Refactor export_qmlfiles and export_qmlplugins to be more generic
  and clean up installed mocks.
[ Albert Astals ]
* Remove empty dirs
* Set the tabbarmodel index as we do on real code It works better :D
  (LP: #1317255)
[ Thomi Richards ]
* Use new import location for ProcessSearchError in process_helpers
  script.
[ Andrea Cimitan ]
* Adds shadow for the carousel
[ Daniel d'Andrada ]
* Remove Revealer component It's not used anywhere anymore. It's been
  replaced by DragHandle.
[ Andy Doan ]
* unlock_device: support more complex reboot/wait cycles Currently
  this script only allows you to override how to "wait" on the device.
  This changes the logic to also support how you go about rebooting
  the device. This is handy for the ubuntu-emulator because adb-reboot
  is not currently supported. However, we also have a more
  sophisticated, fool-proof way we reboot/wait in the CI lab that
  would be nice to take advantage of:
  http://bazaar.launchpad.net/~ubuntu-test-case-dev/ubuntu-test-
  cases/touch/view/head:/scripts/reboot-and-wait
[ CI bot ]
* Resync trunk
[ Michael Zanetti ]
* support appid:// entries in gsettings schema and make
  findDesktopFile work with short-appid (LP: #1239750)
[ Antti Kaijanmäki ]
* Indicators/RootActionState: use g_variant_iter_loop to extract
  icons.
[ Andrea Cimitan ]
* Improve padding in Text preview widget. (LP: #1316683)
[ CI bot ]
* Resync trunk
[ Nick Dedekind ]
* Removed binding loop from Unity.Indicators.MenuContentActivator
  Change handler for QMLListProperty used by MenuContent.qml:
  menuActivator.content[index].active If we're already asking for the
  index, we know it exists already. No need to send a
  changeNotification on an implied creation.
[ Josh Arenson ]
* Implements usage-style documentation for unity8 executable. Fixes
  lp:1269282 (LP: #1269282)
[ Albert Astals ]
* Create specialized Card code in Javascript instead of having various
  copied&pasted files (LP: #1297197)
[ Michał Sawicz ]
* Remove HUD from the bottom edge. Again.

885. By Ying-Chun Liu

Fix ZoomableImage test fail. Use relative scale.
Fix PreviewZoomableImage fail.

886. By Ying-Chun Liu

Fix indent.

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
Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Only tests changed, so no need for a test run other than running the tests.

 * Did CI run pass?
No, some other known broken tests

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/qmltests/Components/tst_ZoomableImage.qml'
--- tests/qmltests/Components/tst_ZoomableImage.qml 2014-04-25 14:48:36 +0000
+++ tests/qmltests/Components/tst_ZoomableImage.qml 2014-05-23 14:07:40 +0000
@@ -98,22 +98,23 @@
98 // move mouse to center98 // move mouse to center
99 mouseMove(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2);99 mouseMove(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2);
100100
101 var oldScale = image.scale;
101 // Test Zoom-in Zoom-out twice.102 // Test Zoom-in Zoom-out twice.
102 for (var c=0; c<2; c++) {103 for (var c=0; c<2; c++) {
103 // zoom in104 // zoom in
104 for (var i=0; i<10; i++) {105 for (var i=0; i<10; i++) {
105 mouseWheel(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2, 0, 10);106 mouseWheel(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2, 0, 10);
106 tryCompare(image, "scale", 1.0 + (i + 1) * 0.1);107 tryCompare(image, "scale", oldScale + (i + 1) * 0.1);
107 compare(flickable.contentWidth, lazyImage.width * image.scale);108 compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
108 compare(flickable.contentHeight, lazyImage.height * image.scale);109 compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
109 }110 }
110111
111 // zoom out112 // zoom out
112 for (var i=0; i<10; i++) {113 for (var i=0; i<10; i++) {
113 mouseWheel(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2, 0, -10);114 mouseWheel(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2, 0, -10);
114 tryCompare(image, "scale", 2.0 - (i + 1) * 0.1);115 tryCompare(image, "scale", oldScale + 1.0 - (i + 1) * 0.1);
115 compare(flickable.contentWidth, lazyImage.width * image.scale);116 compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
116 compare(flickable.contentHeight, lazyImage.height * image.scale);117 compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
117 }118 }
118 }119 }
119 }120 }
@@ -123,16 +124,12 @@
123 zoomable:false,124 zoomable:false,
124 answer1: true,125 answer1: true,
125 answer2: false,126 answer2: false,
126 answer3: true,127 answer3: true },
127 answer4: 1.0,
128 answer5: 1.0 },
129 { source:widgetData2["source"],128 { source:widgetData2["source"],
130 zoomable:true,129 zoomable:true,
131 answer1: false,130 answer1: false,
132 answer2: true,131 answer2: true,
133 answer3: false,132 answer3: false }
134 answer4: 1.7740461882048026,
135 answer5: 1.0 }
136 ]133 ]
137 }134 }
138135
@@ -163,7 +160,7 @@
163 var y2End = zoomableImage.height * 5 / 6;160 var y2End = zoomableImage.height * 5 / 6;
164161
165 var oldScale = image.scale;162 var oldScale = image.scale;
166163 var newScale = -1;
167 // move mouse to center164 // move mouse to center
168 mouseMove(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2);165 mouseMove(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2);
169166
@@ -172,20 +169,25 @@
172 wait(3000); // have to delay between two consequent pinch event.169 wait(3000); // have to delay between two consequent pinch event.
173 // pinch zoom-in170 // pinch zoom-in
174 touchPinch(zoomableImage, x1Start, y1Start, x1End, y1End, x2Start, y2Start, x2End, y2End);171 touchPinch(zoomableImage, x1Start, y1Start, x1End, y1End, x2Start, y2Start, x2End, y2End);
172 waitForRendering(image);
175173
176 tryCompare(image, "scale", data.answer4);174 if (newScale == -1) {
177 var newScale = image.scale;175 newScale = image.scale;
176 }
177 tryCompare(image, "scale", newScale);
178 compare(newScale == oldScale, data.answer1, "scale factor not equal: "+ oldScale + "=?" + newScale);178 compare(newScale == oldScale, data.answer1, "scale factor not equal: "+ oldScale + "=?" + newScale);
179 compare(newScale > oldScale, data.answer2, "scale factor didn't changed");179 compare(newScale > oldScale, data.answer2, "scale factor didn't changed");
180 compare(signalSpy.count == 0, data.answer3, "scale signal count error");180 compare(signalSpy.count == 0, data.answer3, "scale signal count error");
181 compare(newScale, data.answer4, "scale factor error");181 compare(image.scale, newScale, "scale factor error");
182 compare(flickable.contentWidth, lazyImage.width * image.scale);182 compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
183 compare(flickable.contentHeight, lazyImage.height * image.scale);183 compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
184184
185 wait(3000); // have to delay between two consequent pinch event.185 wait(3000); // have to delay between two consequent pinch event.
186 // pinch zoom-out186 // pinch zoom-out
187 touchPinch(zoomableImage, x1End, y1End, x1Start, y1Start, x2End, y2End, x2Start, y2Start);187 touchPinch(zoomableImage, x1End, y1End, x1Start, y1Start, x2End, y2End, x2Start, y2Start);
188 tryCompare(image, "scale", data.answer5);188 tryCompare(image, "scale", oldScale);
189 compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
190 compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
189 }191 }
190 }192 }
191 }193 }
192194
=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml'
--- tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml 2014-04-08 12:38:12 +0000
+++ tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml 2014-05-23 14:07:40 +0000
@@ -26,14 +26,14 @@
26 color: "lightgrey"26 color: "lightgrey"
2727
28 property var widgetData0: {28 property var widgetData0: {
29 "source": ""
30 }
31
32 property var widgetData1: {
33 "source": Qt.resolvedUrl("../artwork/checkers.png"),29 "source": Qt.resolvedUrl("../artwork/checkers.png"),
34 "zoomable": false30 "zoomable": false
35 }31 }
3632
33 property var widgetData1: {
34 "source": ""
35 }
36
37 PreviewZoomableImage {37 PreviewZoomableImage {
38 id: zoomableImage38 id: zoomableImage
39 anchors.fill: parent39 anchors.fill: parent
@@ -49,11 +49,13 @@
4949
50 zoomableImage.widgetData = widgetData0;50 zoomableImage.widgetData = widgetData0;
51 waitForRendering(zoomableImage);51 waitForRendering(zoomableImage);
52 waitForRendering(image);
53 tryCompare(image, "imageState", "ready");
54
55 zoomableImage.widgetData = widgetData1;
56 waitForRendering(zoomableImage);
57 waitForRendering(image);
52 tryCompare(image, "imageState", "default");58 tryCompare(image, "imageState", "default");
53
54 zoomableImage.widgetData = widgetData1;
55 waitForRendering(zoomableImage);
56 tryCompare(image, "imageState", "ready");
57 }59 }
58 }60 }
59}61}

Subscribers

People subscribed via source and target branches