Merge lp:~paulliu/unity8/zoomImage into lp:unity8

Proposed by Ying-Chun Liu
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 754
Merged at revision: 873
Proposed branch: lp:~paulliu/unity8/zoomImage
Merge into: lp:unity8
Diff against target: 467 lines (+383/-10)
7 files modified
qml/Components/LazyImage.qml (+1/-0)
qml/Components/ZoomableImage.qml (+153/-0)
qml/Dash/Previews/PreviewZoomableImage.qml (+4/-7)
tests/qmltests/CMakeLists.txt (+1/-0)
tests/qmltests/Components/tst_ZoomableImage.qml (+192/-0)
tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml (+6/-3)
tests/utils/modules/Unity/Test/UnityTestCase.qml (+26/-0)
To merge this branch: bzr merge lp:~paulliu/unity8/zoomImage
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Andrea Cimitan (community) Needs Fixing
Michał Sawicz Needs Information
Review via email: mp+207941@code.launchpad.net

Commit message

Add Zoomable Image for Preview widgets.

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.
lp:~paulliu/unity8/zoomImage updated
736. By Ying-Chun Liu

Fix coding style.

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

qml/Dash/Previews/PreviewZoomableImage.qml: bad whitespace in lines 94, 134

lp:~paulliu/unity8/zoomImage updated
737. By Ying-Chun Liu

fix whitespace error.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:737
http://jenkins.qa.ubuntu.com/job/unity8-ci/2403/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/3481
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3118/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1273
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/924
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/928
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/928/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/924
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3061
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3484
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3484/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3120
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3120/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5505/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/4264

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2403/rebuild

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

Is AnimatedImage used here for a reason?

review: Needs Information
Revision history for this message
Ying-Chun Liu (paulliu) wrote :

No. So should I use LazyImage here?

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

AnimatedImage is meant for... animated, as in multiple-frame images, which we don't expect to support here. Yes, use LazyImage to maintain the loading transitions.

lp:~paulliu/unity8/zoomImage updated
738. By Ying-Chun Liu

Use LazyImage instead of AnimatedImage

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:738
http://jenkins.qa.ubuntu.com/job/unity8-ci/2468/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/3834
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3419/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1338/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/989
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/993
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/993/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/989
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3365
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3852
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3852/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3421
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3421/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5781/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/4683

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2468/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

Where did you get all the logic for the pinch to zoom? It does make sense to me to have this zoomable image as a separate component, then integrated into the preview, rather than having it directly here in the previews. I'd then add it to either the SDK or the Components folder in qml/Components unity8. (then more tests for it!)

review: Needs Fixing
Revision history for this message
Ying-Chun Liu (paulliu) wrote :

OK. I'll re-factor it to the Components folder.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Doesn't merge with current unity8 trunk

review: Needs Fixing
lp:~paulliu/unity8/zoomImage updated
739. By Ying-Chun Liu

Move ZoomableImage to Components.
Add more unit tests.

740. By Ying-Chun Liu

Merge trunk.

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 :

FAILED: Continuous integration, rev:740
http://jenkins.qa.ubuntu.com/job/unity8-ci/2548/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4040
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3625
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1418
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1069
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1073
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1073/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1069
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3525
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4083
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4083/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3627
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3627/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5952
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/4932

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2548/rebuild

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

PASSED: Continuous integration, rev:740
http://jenkins.qa.ubuntu.com/job/unity8-ci/2581/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4115
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3699
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1451
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1102
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1106
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1106/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1102
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3590
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4176
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4176/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3701
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3701/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6018
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5045

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2581/rebuild

review: Approve (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

I noticed that the code for ZoomableImage comes from http://developer.nokia.com/community/wiki/images/0/02/QuickFlickr.zip?20131030203027

that is GPLv2 or GPLv3 (both mentioned in the copyright file)

I'd like to see some clarification on the algorithm used, especially this multiplication for 0.98 in calculateSize

Tests:
- ZoomableImage
I'd also make tests more robust, by checking if the scale is exactly the one expected, and not only if the image zooms in or out.

Adding wait for the pinch action to the mouse events is not optimal, and might not work with jenkins (I'd like a comment from danrader on that).

- Preview
The
58 + wait(3000);
Looks like a mistake, should be replaced with a tryCompare if you need to wait for a partcular state to load.

I'd not replicate (almost) the test of the zoomable image (this is already tested), but just add the bits we need to test on the integration.

lp:~paulliu/unity8/zoomImage updated
741. By Ying-Chun Liu

Rewrite the zoomable image code.

742. By Ying-Chun Liu

Remove the tests which are already in ZoomableImage's test.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:741
http://jenkins.qa.ubuntu.com/job/unity8-ci/2609/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4187
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3771
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1479
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1130
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1134
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1134/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1130
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3640
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4255
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4255/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3773
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3773/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6071
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5132

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2609/rebuild

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

FAILED: Continuous integration, rev:742
http://jenkins.qa.ubuntu.com/job/unity8-ci/2614/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4201
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3785
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1484
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1135
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1139
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1139/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1135
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3649
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4271
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4271/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3787
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3787/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6083
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5148

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2614/rebuild

review: Needs Fixing (continuous-integration)
lp:~paulliu/unity8/zoomImage updated
743. By Ying-Chun Liu

Fix PreviewZoomableImage unit test.

744. By Ying-Chun Liu

merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:744
http://jenkins.qa.ubuntu.com/job/unity8-ci/2666/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4345/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3944
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1536
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1187
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1191
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1191/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1187
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3765/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4444
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4444/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3946
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3946/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6222
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5360

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2666/rebuild

review: Needs Fixing (continuous-integration)
lp:~paulliu/unity8/zoomImage updated
745. By Ying-Chun Liu

Test scale factor.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:745
http://jenkins.qa.ubuntu.com/job/unity8-ci/2667/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4347
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3946
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1537
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1188
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1192
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1192/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1188
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3767
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4446
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4446/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3948
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3948/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6224
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5364

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2667/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Can you please set widgetData1 as default widget data so when we do
make tryPreviewZoomableImage
and we have merged lp:~mzanetti/unity8/fix-make-trySomething-qt-5.2 we got something?

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

Also how did you test this?

review: Needs Information
lp:~paulliu/unity8/zoomImage updated
746. By Ying-Chun Liu

Add testing mouse wheel and flickable width and height.

Revision history for this message
Ying-Chun Liu (paulliu) wrote :

ok. I'll add it. But I'm currently encountering a strange bug.
PinchArea receives nothing again. I'm checking it.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~paulliu/unity8/zoomImage updated
747. By Ying-Chun Liu

Fix PinchArea and tests.

748. By Ying-Chun Liu

Fix some unit test.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:747
http://jenkins.qa.ubuntu.com/job/unity8-ci/2748/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-trusty-touch/82
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4597
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1618
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1269
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1273
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1273/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1269
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/82
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4192
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4192/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5730
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3959
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4721
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4721/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2748/rebuild

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

FAILED: Continuous integration, rev:748
http://jenkins.qa.ubuntu.com/job/unity8-ci/2751/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-trusty-touch/95
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4616
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1621/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1272
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1276
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1276/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1272
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/92
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4209
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4209/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5748
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3973
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4740
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4740/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2751/rebuild

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

FAILED: Continuous integration, rev:748
http://jenkins.qa.ubuntu.com/job/unity8-ci/2765/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-trusty-touch/117
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4651
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1635
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1286
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1290
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1290/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1286
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/114
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4238
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4238/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5792
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/4009
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4777
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4777/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2765/rebuild

review: Needs Fixing (continuous-integration)
lp:~paulliu/unity8/zoomImage updated
749. By Ying-Chun Liu

Add zoom-out unit test

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:749
http://jenkins.qa.ubuntu.com/job/unity8-ci/2786/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-trusty-touch/154
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4711
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1650
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/1307
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1311
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/1311/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/1307
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/150
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4294
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4294/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5860
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/4067
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4838
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4838/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2786/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Can you please merge trunk into it? Otherwise it doesn't build.

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :
Download full text (6.8 KiB)

testZoomableImage doesn't pass here

tsdgeos_work@xps:~/phablet/unity8/zoomImage/builddir$ make testZoomableImage
Scanning dependencies of target testZoomableImage
********* Start testing of qmltestrunner *********
Config: Using QtTest library 5.2.1, Qt 5.2.1
PASS : qmltestrunner::ZoomableImageTest::initTestCase()
PASS : qmltestrunner::ZoomableImageTest::test_loadImage()
PASS : qmltestrunner::ZoomableImageTest::test_mousewheel()
PASS : qmltestrunner::ZoomableImageTest::test_pinch(row 0)
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.0223712539150298 image.scale = 1.0223712539150298
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.0357940073993845 image.scale = 1.0357940073993845
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.0581652649948587 image.scale = 1.0581652649948587
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.0738228162358237 image.scale = 1.0738228162358237
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.0894850291524478 image.scale = 1.0894850291524478
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.1118562916099062 image.scale = 1.1118562916099062
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.1252790499663978 image.scale = 1.1252790499663978
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.1476503152894069 image.scale = 1.1476503152894069
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.1633080509221423 image.scale = 1.1633080509221423
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.1789700895053916 image.scale = 1.1789700895053916
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.201341358651656 image.scale = 1.201341358651656
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.214764120838203 image.scale = 1.214764120838203
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.2371353922590045 image.scale = 1.2371353922590045
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.252793285608461 image.scale = 1.252793285608461
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.268455174455575 image.scale = 1.268455174455575
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.2908264489369636 image.scale = 1.2908264489369636
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.30424921418879 image.scale = 1.30424921418879
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.3266204905056826 image.scale = 1.3266204905056826
QDEBUG : qmltestrunner::ZoomableImageTest::test_pinch(row 1) Pinch Updated pinch.scale = 1.3422785202947793 image.scale = 1.3422785202947793
QDEBUG : qmltestrunner::ZoomableI...

Read more...

review: Needs Fixing
lp:~paulliu/unity8/zoomImage updated
750. By Ying-Chun Liu

Merge upstream
[ Albert Astals ]
* Fix last item X position Fixes clicking on the last item sometimes
  not working (LP: #1301871)
* Use upstart in ./run Makes it so that you can use the lock button on
  the device without getting that nasty hwc crash
* Remove AnimationControllerWithSignals.
* Use the correct delegate base item for the Carousel test
* Some simplification in DashContent Kill the ScopeDelegateMapper in
  favour of a simple if (that will eventually go away). Removal of all
  the fake scopes in the tests that added nothing of value to the
  tests. Removal of movementEnded signal that was unused. Removal of
  movementStarted and positionedAtBeginning signals that were being
  used as function calls. Rework DashContent tests so they what the
  function does what it is supposed to do instead of just making sure
  QML signals work .
* Improve Card creation time by adding loaders that make sure only
  what's needed is loaded In my computer it goes from RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtSubtitleMascotSummaryMode
  l": 3.217 msecs per iteration (total: 3,218, iterations: 1000)
  RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtSubtitleMascotModel":
  1.647 msecs per iteration (total: 1,648, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtSubtitleModel": 1.514
  msecs per iteration (total: 1,515, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtModel": 1.471 msecs per
  iteration (total: 1,471, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardArtModel": 1.447 msecs per
  iteration (total: 1,448, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardTitleModel": 1.276 msecs per
  iteration (total: 1,276, iterations: 1000) to RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtSubtitleMascotSummaryMode
  l": 2.916 msecs per iteration (total: 2,917, iterations: 1000)
  RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtSubtitleMascotModel":
  1.504 msecs per iteration (total: 1,504, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtSubtitleModel": 1.060
  msecs per iteration (total: 1,061, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardTitleArtModel": 1.052 msecs per
  iteration (total: 1,053, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardArtModel": 0.727 msecs per
  iteration (total: 728, iterations: 1000) RESULT :
  qmltestrunner::benchmark_time:"cardTitleModel": 0.817 msecs per
  iteration (total: 818, iterations: 1000) (LP: #1297197)
[ Allan LeSage ]
* DashApps emulator get_applications should return a list ordered by
  visible y, x.
[ Andrea Cimitan ]
* Workaround for lp1301309 until fixes for palette in ui toolkit (LP:
  #1301309)
[ Leo Arias ]
* Reverted the change that returns application cards instead of
  titles.
[ Nick Dedekind ]
* Indicator services started by unity8 upstart configuration rather
  than manual emmision from indicator manager.
[ Mirco Müller ]
* Fix notification ap-test assertions.
[ Michael Terry ]
* Use new tablet and phone backgrounds from Design.
[ Michael Zanetti ]
* workaround the QTestLogger assertion issue with make tryXyz and our
  custom uqmlscene
[ Michael Terry ]
* When an application requests focus, handle it in Shell.qml by hiding
  the greeter and stopping any edge demo. (LP: #1227753)
[ Leo Arias ]
* Use subprocess.check_call when caling url-dispatcher, so an error
  will be raised if it fails.
* Test application life cycle with fake apps, instead of messaging and
  address book.
[ Didier Roche ]
* Resync trunk with previous revert upload
[ Michał Sawicz ]
* Set the Qt.ImhNoPredictiveText flag on wifi password field, fixes
  lp:1291575 (LP: #1291575)
[ Albert Astals ]
* Take into account the originY when specifying the delegate ranges
  Fixes bug #1300302 (LP: #1300302)
[ CI bot ]
* Resync trunk
[ Allan LeSage ]
* Swiping open an indicator must show its correct title--protect
  against lp:1253804 . (LP: #1253804)
[ Alexander Sack ]
* Fix TypeError: issue seen in system_integration autopilot test on
  image 279. (LP: #1303685)
[ Bill Filler ]
* Set the Qt.ImhNoPredictiveText flag on wifi password field, fixes
  lp:1291575 (LP: #1291575)
[ Leo Arias ]
* Added a search autopilot helper.
[ Michael Terry ]
* Provide a all-in-one script for getting a device to an unlocked
  state.
* Revert to previous version as it's linked to latest sdk change which
  is making gallery-app AP tests failing on the CI dashboard
[ Albert Astals ]
* Adapt to new TabBar
[ Michael Terry ]
* Re-enable test_networkmanager_integration autopilot test on phone
  platforms
[ CI bot ]
* Resync trunk
[ Leo Arias ]
* Reverted the open_preview autopilot helper to return a Preview
  object.
[ Albert Astals ]
* If not running in Mir load the "fake" application manager (LP:
  #1301547)
* Remove unused properties from DashRenderer
[ Michael Zanetti ]
* Fix tests after right edge merge. Drop old stages tests. Fix right
  edge tests if someone doesn't have the GRID_UNIT_PX exported. make
  GenericScopeView test more robust that broke because the ordering
  changed
* add "make xvfbtestSomething" target to run qml tests in xvfb
* make the "make test" commit hook work again
[ Michał Sawicz ]
* Bump version to ensure incompatibility with previous Unity.Application
  implementations.
* We'll only have the unity-mir and mock Ubuntu.Application plugins
  now, no need for mangling the import paths.
[ Michal Hruby ]
* Remove the albumart image provider. (LP: #1262711)
* Don't reset search string after 2 seconds. (LP: #1297246)
[ James Henstridge ]
* Remove the albumart image provider. (LP: #1262711)
[ Albert Astals ]
* Carousel: Add test to make sure we only create the needed delegates
  and not more
* LVWPH: Remove processEvents() call from updatePolish() It causes
  some reentrancy issues and in some times you end up in polishItems()
  with items that have been deleted because you called processEvents()
  This means i need a small tweak in itemGeometryChanged to not
  reposition items if we are inside a setContentHeight call and two
  small tweaks to tests since now things happen in a different order
  and numbers are different (though equivalent) (LP: #1297240)
* Card.qml binding loops are gone. hooray \o/ Also made the aspect
  properties readonly
[ Mirco Müller ]
* A potential fix for "Cannot read property 'state' of null"-failure
  on Jenkins with the VisualSnapDecisionsQueue QML-test of
  notifications.
[ Michael Terry ]
* Pass user's preference for auto-brightness on to powerd. (LP:
  #1273174)
[ Michael Zanetti ]
* Registers a dummy QObject as QTestRootObject in uqmlscene in order
  to fix make trySomething with Qt 5.2.
* For now, have libunity-private depending on libunity-core-6.0-9 as the
  gsettings schema is here. The dependency wasn't direct and dropped from
  Touch image #271. Consequently, unity8 didn't start (gsettings
  segfaulting).
  Proper strategy will be to include the schema in another package to only
  pull it.

751. By Ying-Chun Liu

re-factor

752. By Ying-Chun Liu

fix whitespace

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 :

Does not seem to work.

How did i test it:
 * Set zoomable: true in PreviewZoomableImage
 * Run it on the phone
 * Go to the music scope and preview a song from Grooveshark that has the non default image ("Sail" in my case)
 * Try to do some zooming around
 * Doesn't work

review: Needs Fixing
lp:~paulliu/unity8/zoomImage updated
753. By Ying-Chun Liu

Fix weirdness centering.

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 :

This is the original situation http://imgur.com/txGuDoa and this after i do some zoom+pan http://imgur.com/P0NyuLo

I don't think it makes sense I can pan "past" the image

review: Needs Fixing
lp:~paulliu/unity8/zoomImage updated
754. By Ying-Chun Liu

Fix strange drag out of bound.

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 :

Code looks good, it changes PreviewZoomableImage to be aligned to the left to be center aligned, it looks ok to me but i remember we had that in the past and then reverted it so i'm going to approve here but leave un-top approved to let Saviq comment on it.

* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes, looks good to me

* Did CI run pass? If not, please explain why.
No, seems mako is stuck in the past or something :/

review: Approve
Revision history for this message
Albert Astals Cid (aacid) wrote :

since i can't find a case in which it regresses and i've been playing with it a bit in the scenario it made it fail last time we tried using a LazyImage there i'm going to top-approve it

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Components/LazyImage.qml'
--- qml/Components/LazyImage.qml 2014-03-21 10:48:42 +0000
+++ qml/Components/LazyImage.qml 2014-04-30 13:51:56 +0000
@@ -36,6 +36,7 @@
36 property alias cache: image.cache36 property alias cache: image.cache
37 property alias horizontalAlignment: image.horizontalAlignment37 property alias horizontalAlignment: image.horizontalAlignment
38 property alias verticalAlignment: image.verticalAlignment38 property alias verticalAlignment: image.verticalAlignment
39 property alias sourceImage: image
3940
40 state: "default"41 state: "default"
4142
4243
=== added file 'qml/Components/ZoomableImage.qml'
--- qml/Components/ZoomableImage.qml 1970-01-01 00:00:00 +0000
+++ qml/Components/ZoomableImage.qml 2014-04-30 13:51:56 +0000
@@ -0,0 +1,153 @@
1/*
2 * Copyright (C) 2014 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19import "../Components"
20
21/*! \brief Zoomable for image.
22
23 This widget shows image contained in source,
24 can be zoomable accordingly with zoomable.
25 */
26
27Item {
28 id: root
29 property alias source: lazyImage.source
30 property var zoomable: false
31 property alias imageState: lazyImage.state
32 property alias scaleTo: lazyImage.scaleTo
33 property alias asynchronous: lazyImage.asynchronous
34
35 Flickable {
36 id: flickable
37 objectName: "flickable"
38 clip: true
39 contentHeight: imageContainer.height
40 contentWidth: imageContainer.width
41
42 onHeightChanged: image.resetScale()
43 onWidthChanged: image.resetScale()
44 anchors.fill: parent
45
46 Item {
47 id: imageContainer
48 objectName: "imageContainer"
49 width: Math.max(image.width * image.scale, flickable.width)
50 height: Math.max(image.height * image.scale, flickable.height)
51
52 Item {
53 id: image
54 objectName: "image"
55 property alias imageState: lazyImage.state
56 property var prevScale
57 anchors.centerIn: parent
58
59 signal imageReloaded
60
61 LazyImage {
62 id: lazyImage
63 objectName: "lazyImage"
64 smooth: !flickable.movingVertically
65 anchors.fill: parent
66 fillMode: Image.PreserveAspectFit
67 scaleTo: "fit"
68
69 onStateChanged: {
70 if (state == "ready") {
71 image.imageReloaded();
72 }
73 }
74 }
75
76 onImageReloaded: {
77 image.height = lazyImage.sourceImage.implicitHeight
78 image.width = lazyImage.sourceImage.implicitWidth
79 image.resetScale();
80 }
81
82 function resetScale() {
83 image.scale = Math.min(flickable.width / image.width, flickable.height / image.height);
84 pinchArea.minScale = image.scale;
85 prevScale = Math.min(image.scale, 1);
86 }
87
88 onScaleChanged: {
89 var currentWidth = width * scale
90 var currentHeight = height * scale
91 var scaleRatio = scale / prevScale
92 if (currentWidth > flickable.width) {
93 var xpos = flickable.width / 2 + flickable.contentX;
94 var xoff = xpos * scaleRatio;
95 flickable.contentX = xoff - flickable.width / 2;
96 }
97 if (currentHeight > flickable.height) {
98 var ypos = flickable.height / 2 + flickable.contentY;
99 var yoff = ypos * scaleRatio;
100 flickable.contentY = yoff - flickable.height / 2;
101 }
102 prevScale = scale;
103 }
104 }
105 }
106
107 PinchArea {
108 id: pinchArea
109 objectName: "pinchArea"
110 property real minScale: 1.0
111 anchors.fill: parent
112 enabled: zoomable ? zoomable : false
113
114 pinch.target: image
115 pinch.minimumScale: minScale
116 pinch.maximumScale: 10
117
118 onPinchFinished: flickable.returnToBounds()
119 }
120
121 MouseArea {
122 id: mouseArea
123 objectName: "mouseArea"
124
125 anchors.fill: parent
126 enabled: zoomable ? zoomable : false
127
128 onWheel: {
129 var startScale = image.scale;
130 if (wheel.angleDelta.y > 0) {
131 image.scale = startScale + 0.1;
132 } else if (wheel.angleDelta.y < 0) {
133 if (image.scale > 0.1 && image.scale > pinchArea.minScale) {
134 image.scale = startScale - 0.1;
135 }
136 }
137 wheel.accepted = true;
138 }
139
140 onPressed: {
141 mouse.accepted = false;
142 }
143
144 onReleased: {
145 mouse.accepted = false;
146 }
147
148 onClicked: {
149 mouse.accepted = false;
150 }
151 }
152 }
153}
0154
=== modified file 'qml/Dash/Previews/PreviewZoomableImage.qml'
--- qml/Dash/Previews/PreviewZoomableImage.qml 2014-02-21 18:41:37 +0000
+++ qml/Dash/Previews/PreviewZoomableImage.qml 2014-04-30 13:51:56 +0000
@@ -28,14 +28,11 @@
28 id: root28 id: root
29 implicitHeight: units.gu(22)29 implicitHeight: units.gu(22)
3030
31 LazyImage {31 ZoomableImage {
32 id: image
32 objectName: "image"33 objectName: "image"
33 anchors {
34 top: parent.top
35 bottom: parent.bottom
36 }
37 scaleTo: "height"
38 source: widgetData["source"]34 source: widgetData["source"]
39 initialWidth: units.gu(13)35 zoomable: widgetData["zoomable"] ? widgetData["zoomable"] : false
36 anchors.fill: parent
40 }37 }
41}38}
4239
=== modified file 'tests/qmltests/CMakeLists.txt'
--- tests/qmltests/CMakeLists.txt 2014-04-22 08:51:33 +0000
+++ tests/qmltests/CMakeLists.txt 2014-04-30 13:51:56 +0000
@@ -32,6 +32,7 @@
32add_qml_test(Components SeeMore)32add_qml_test(Components SeeMore)
33add_qml_test(Components Showable)33add_qml_test(Components Showable)
34add_qml_test(Components PageHeaderLabel)34add_qml_test(Components PageHeaderLabel)
35add_qml_test(Components ZoomableImage)
35add_qml_test(Dash Dash IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})36add_qml_test(Dash Dash IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})
36add_qml_test(Dash DashContent IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})37add_qml_test(Dash DashContent IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})
37add_qml_test(Dash Card)38add_qml_test(Dash Card)
3839
=== added file 'tests/qmltests/Components/tst_ZoomableImage.qml'
--- tests/qmltests/Components/tst_ZoomableImage.qml 1970-01-01 00:00:00 +0000
+++ tests/qmltests/Components/tst_ZoomableImage.qml 2014-04-30 13:51:56 +0000
@@ -0,0 +1,192 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import QtTest 1.0
19import "../../../qml/Components"
20import Unity.Test 0.1 as UT
21
22Rectangle {
23 id: root
24 width: units.gu(30)
25 height: units.gu(60)
26 color: "lightgrey"
27
28 property var widgetData0: {
29 "source": "",
30 "zoomable": false
31 }
32
33 property var widgetData1: {
34 "source": "../../../qml/graphics/phone_background.jpg",
35 "zoomable": false
36 }
37
38 property var widgetData2: {
39 "source": "../../../qml/Dash/graphics/phone/screenshots/gallery@12.png",
40 "zoomable": true
41 }
42
43 ZoomableImage {
44 id: zoomableImage
45 width: parent.width
46 anchors.fill: parent
47 asynchronous: false
48 }
49
50 SignalSpy {
51 id: signalSpy
52 }
53
54 UT.UnityTestCase {
55 name: "ZoomableImageTest"
56 when: windowShown
57
58 function test_loadImage() {
59 var lazyImage = findChild(zoomableImage, "lazyImage");
60
61 zoomableImage.source = widgetData0["source"];
62 zoomableImage.zoomable = widgetData0["zoomable"];
63 waitForRendering(zoomableImage);
64 tryCompare(zoomableImage, "imageState", "default");
65
66 signalSpy.signalName = "onStateChanged";
67 signalSpy.target = lazyImage;
68 signalSpy.clear();
69
70 zoomableImage.source = widgetData1["source"];
71 zoomableImage.zoomable = widgetData1["zoomable"];
72 waitForRendering(lazyImage);
73 tryCompareFunction(function() { return get_filename(lazyImage.source.toString()) === get_filename(widgetData1["source"]); }, true);
74 waitForRendering(zoomableImage);
75 tryCompare(zoomableImage, "imageState", "ready");
76 compare (signalSpy.count, 1);
77 }
78
79 function get_filename(a) {
80 var wordsA = a.split("/");
81 var filenameA = wordsA[wordsA.length-1];
82 return filenameA;
83 }
84
85 function test_mousewheel() {
86 var image = findChild(zoomableImage, "image");
87 var lazyImage = findChild(zoomableImage, "lazyImage");
88 var flickable = findChild(zoomableImage, "flickable");
89
90 zoomableImage.source = widgetData2["source"];
91 zoomableImage.zoomable = true;
92 waitForRendering(zoomableImage);
93
94 tryCompare(zoomableImage, "imageState", "ready");
95 tryCompareFunction(function() { return get_filename(lazyImage.source.toString()) === get_filename(widgetData2["source"]); }, true);
96 waitForRendering(image);
97
98 // move mouse to center
99 mouseMove(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2);
100
101 // Test Zoom-in Zoom-out twice.
102 for (var c=0; c<2; c++) {
103 // zoom in
104 for (var i=0; i<10; i++) {
105 mouseWheel(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2, 0, 10);
106 tryCompare(image, "scale", 1.0 + (i + 1) * 0.1);
107 compare(flickable.contentWidth, lazyImage.width * image.scale);
108 compare(flickable.contentHeight, lazyImage.height * image.scale);
109 }
110
111 // zoom out
112 for (var i=0; i<10; i++) {
113 mouseWheel(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2, 0, -10);
114 tryCompare(image, "scale", 2.0 - (i + 1) * 0.1);
115 compare(flickable.contentWidth, lazyImage.width * image.scale);
116 compare(flickable.contentHeight, lazyImage.height * image.scale);
117 }
118 }
119 }
120
121 function test_pinch_data() {
122 return [ { source:widgetData2["source"],
123 zoomable:false,
124 answer1: true,
125 answer2: false,
126 answer3: true,
127 answer4: 1.0,
128 answer5: 1.0 },
129 { source:widgetData2["source"],
130 zoomable:true,
131 answer1: false,
132 answer2: true,
133 answer3: false,
134 answer4: 1.7740461882048026,
135 answer5: 1.0 }
136 ]
137 }
138
139 function test_pinch(data) {
140 var image = findChild(zoomableImage, "image");
141 var lazyImage = findChild(zoomableImage, "lazyImage");
142 var flickable = findChild(zoomableImage, "flickable");
143
144 signalSpy.signalName = "onScaleChanged";
145 signalSpy.target = image;
146 signalSpy.clear();
147
148 zoomableImage.source = data.source;
149 zoomableImage.zoomable = data.zoomable;
150 waitForRendering(zoomableImage);
151
152 tryCompare(zoomableImage, "imageState", "ready");
153 tryCompareFunction(function() { return get_filename(lazyImage.source.toString()) === get_filename(data.source); }, true);
154 waitForRendering(image);
155
156 var x1Start = zoomableImage.width * 2 / 6;
157 var y1Start = zoomableImage.height * 2 / 6;
158 var x1End = zoomableImage.width * 1 / 6;
159 var y1End = zoomableImage.height * 1 / 6;
160 var x2Start = zoomableImage.width * 4 / 6;
161 var y2Start = zoomableImage.height * 4 / 6;
162 var x2End = zoomableImage.width * 5 / 6;
163 var y2End = zoomableImage.height * 5 / 6;
164
165 var oldScale = image.scale;
166
167 // move mouse to center
168 mouseMove(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2);
169
170 // Test Zoom-in Zoom-out twice.
171 for (var c=0; c<2; c++) {
172 wait(3000); // have to delay between two consequent pinch event.
173 // pinch zoom-in
174 touchPinch(zoomableImage, x1Start, y1Start, x1End, y1End, x2Start, y2Start, x2End, y2End);
175
176 tryCompare(image, "scale", data.answer4);
177 var newScale = image.scale;
178 compare(newScale == oldScale, data.answer1, "scale factor not equal: "+ oldScale + "=?" + newScale);
179 compare(newScale > oldScale, data.answer2, "scale factor didn't changed");
180 compare(signalSpy.count == 0, data.answer3, "scale signal count error");
181 compare(newScale, data.answer4, "scale factor error");
182 compare(flickable.contentWidth, lazyImage.width * image.scale);
183 compare(flickable.contentHeight, lazyImage.height * image.scale);
184
185 wait(3000); // have to delay between two consequent pinch event.
186 // pinch zoom-out
187 touchPinch(zoomableImage, x1End, y1End, x1Start, y1Start, x2End, y2End, x2Start, y2Start);
188 tryCompare(image, "scale", data.answer5);
189 }
190 }
191 }
192}
0193
=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml'
--- tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml 2014-03-03 10:43:23 +0000
+++ tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml 2014-04-30 13:51:56 +0000
@@ -36,7 +36,8 @@
3636
37 PreviewZoomableImage {37 PreviewZoomableImage {
38 id: zoomableImage38 id: zoomableImage
39 width: parent.width39 anchors.fill: parent
40 widgetData: widgetData1
40 }41 }
4142
42 UT.UnityTestCase {43 UT.UnityTestCase {
@@ -47,10 +48,12 @@
47 var image = findChild(zoomableImage, "image");48 var image = findChild(zoomableImage, "image");
4849
49 zoomableImage.widgetData = widgetData0;50 zoomableImage.widgetData = widgetData0;
50 tryCompare(image, "state", "default");51 waitForRendering(zoomableImage);
52 tryCompare(image, "imageState", "default");
5153
52 zoomableImage.widgetData = widgetData1;54 zoomableImage.widgetData = widgetData1;
53 tryCompare(image, "state", "ready");55 waitForRendering(zoomableImage);
56 tryCompare(image, "imageState", "ready");
54 }57 }
55 }58 }
56}59}
5760
=== modified file 'tests/utils/modules/Unity/Test/UnityTestCase.qml'
--- tests/utils/modules/Unity/Test/UnityTestCase.qml 2014-02-28 15:15:21 +0000
+++ tests/utils/modules/Unity/Test/UnityTestCase.qml 2014-04-30 13:51:56 +0000
@@ -260,6 +260,32 @@
260 }260 }
261 }261 }
262262
263 function touchPinch(item, x1Start, y1Start, x1End, y1End, x2Start, y2Start, x2End, y2End) {
264 // Make sure the item is rendered
265 waitForRendering(item);
266
267 var event1 = touchEvent();
268 // first finger
269 event1.press(0, x1Start, y1Start);
270 event1.commit();
271 // second finger
272 event1.stationary(0);
273 event1.press(1, x2Start, y2Start);
274 event1.commit();
275
276 // pinch
277 for (var i = 0.0; i < 1.0; i += 0.02) {
278 event1.move(0, x1Start + (x1End - x1Start) * i, y1Start + (y1End - y1Start) * i);
279 event1.move(1, x2Start + (x2End - x2Start) * i, y2Start + (y2End - y2Start) * i);
280 event1.commit();
281 }
282
283 // release
284 event1.release(0, x1End, y1End);
285 event1.release(1, x2End, y2End);
286 event1.commit();
287 }
288
263 function fetchRootItem(item) {289 function fetchRootItem(item) {
264 if (item.parent)290 if (item.parent)
265 return fetchRootItem(item.parent)291 return fetchRootItem(item.parent)

Subscribers

People subscribed via source and target branches