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.
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
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 on 2014-05-22

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 on 2014-05-23

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

886. By Ying-Chun Liu on 2014-05-23

Fix indent.

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
1=== modified file 'tests/qmltests/Components/tst_ZoomableImage.qml'
2--- tests/qmltests/Components/tst_ZoomableImage.qml 2014-04-25 14:48:36 +0000
3+++ tests/qmltests/Components/tst_ZoomableImage.qml 2014-05-23 14:07:40 +0000
4@@ -98,22 +98,23 @@
5 // move mouse to center
6 mouseMove(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2);
7
8+ var oldScale = image.scale;
9 // Test Zoom-in Zoom-out twice.
10 for (var c=0; c<2; c++) {
11 // zoom in
12 for (var i=0; i<10; i++) {
13 mouseWheel(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2, 0, 10);
14- tryCompare(image, "scale", 1.0 + (i + 1) * 0.1);
15- compare(flickable.contentWidth, lazyImage.width * image.scale);
16- compare(flickable.contentHeight, lazyImage.height * image.scale);
17+ tryCompare(image, "scale", oldScale + (i + 1) * 0.1);
18+ compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
19+ compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
20 }
21
22 // zoom out
23 for (var i=0; i<10; i++) {
24 mouseWheel(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2, 0, -10);
25- tryCompare(image, "scale", 2.0 - (i + 1) * 0.1);
26- compare(flickable.contentWidth, lazyImage.width * image.scale);
27- compare(flickable.contentHeight, lazyImage.height * image.scale);
28+ tryCompare(image, "scale", oldScale + 1.0 - (i + 1) * 0.1);
29+ compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
30+ compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
31 }
32 }
33 }
34@@ -123,16 +124,12 @@
35 zoomable:false,
36 answer1: true,
37 answer2: false,
38- answer3: true,
39- answer4: 1.0,
40- answer5: 1.0 },
41+ answer3: true },
42 { source:widgetData2["source"],
43 zoomable:true,
44 answer1: false,
45 answer2: true,
46- answer3: false,
47- answer4: 1.7740461882048026,
48- answer5: 1.0 }
49+ answer3: false }
50 ]
51 }
52
53@@ -163,7 +160,7 @@
54 var y2End = zoomableImage.height * 5 / 6;
55
56 var oldScale = image.scale;
57-
58+ var newScale = -1;
59 // move mouse to center
60 mouseMove(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2);
61
62@@ -172,20 +169,25 @@
63 wait(3000); // have to delay between two consequent pinch event.
64 // pinch zoom-in
65 touchPinch(zoomableImage, x1Start, y1Start, x1End, y1End, x2Start, y2Start, x2End, y2End);
66+ waitForRendering(image);
67
68- tryCompare(image, "scale", data.answer4);
69- var newScale = image.scale;
70+ if (newScale == -1) {
71+ newScale = image.scale;
72+ }
73+ tryCompare(image, "scale", newScale);
74 compare(newScale == oldScale, data.answer1, "scale factor not equal: "+ oldScale + "=?" + newScale);
75 compare(newScale > oldScale, data.answer2, "scale factor didn't changed");
76 compare(signalSpy.count == 0, data.answer3, "scale signal count error");
77- compare(newScale, data.answer4, "scale factor error");
78- compare(flickable.contentWidth, lazyImage.width * image.scale);
79- compare(flickable.contentHeight, lazyImage.height * image.scale);
80+ compare(image.scale, newScale, "scale factor error");
81+ compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
82+ compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
83
84 wait(3000); // have to delay between two consequent pinch event.
85 // pinch zoom-out
86 touchPinch(zoomableImage, x1End, y1End, x1Start, y1Start, x2End, y2End, x2Start, y2Start);
87- tryCompare(image, "scale", data.answer5);
88+ tryCompare(image, "scale", oldScale);
89+ compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
90+ compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
91 }
92 }
93 }
94
95=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml'
96--- tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml 2014-04-08 12:38:12 +0000
97+++ tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml 2014-05-23 14:07:40 +0000
98@@ -26,14 +26,14 @@
99 color: "lightgrey"
100
101 property var widgetData0: {
102- "source": ""
103- }
104-
105- property var widgetData1: {
106 "source": Qt.resolvedUrl("../artwork/checkers.png"),
107 "zoomable": false
108 }
109
110+ property var widgetData1: {
111+ "source": ""
112+ }
113+
114 PreviewZoomableImage {
115 id: zoomableImage
116 anchors.fill: parent
117@@ -49,11 +49,13 @@
118
119 zoomableImage.widgetData = widgetData0;
120 waitForRendering(zoomableImage);
121+ waitForRendering(image);
122+ tryCompare(image, "imageState", "ready");
123+
124+ zoomableImage.widgetData = widgetData1;
125+ waitForRendering(zoomableImage);
126+ waitForRendering(image);
127 tryCompare(image, "imageState", "default");
128-
129- zoomableImage.widgetData = widgetData1;
130- waitForRendering(zoomableImage);
131- tryCompare(image, "imageState", "ready");
132 }
133 }
134 }

Subscribers

People subscribed via source and target branches