Merge lp:~dandrader/unity8/splashRotation into lp:unity8

Proposed by Daniel d'Andrada on 2016-06-14
Status: Merged
Approved by: Albert Astals Cid on 2016-06-23
Approved revision: 2496
Merged at revision: 2556
Proposed branch: lp:~dandrader/unity8/splashRotation
Merge into: lp:unity8
Diff against target: 527 lines (+233/-105)
5 files modified
qml/Stages/ApplicationWindow.qml (+6/-0)
qml/Stages/SpreadDelegate.qml (+71/-81)
tests/mocks/Unity/Application/MirSurfaceItem.cpp (+39/-12)
tests/mocks/Unity/Application/MirSurfaceItem.h (+2/-0)
tests/qmltests/Stages/tst_SpreadDelegate.qml (+115/-12)
To merge this branch: bzr merge lp:~dandrader/unity8/splashRotation
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing on 2016-06-29
Albert Astals Cid (community) 2016-06-14 Approve on 2016-06-23
Review via email: mp+297318@code.launchpad.net

Commit Message

Fix splashscreen orientation when app rotates own contents

+ Refactor states code in SpreadDelegate, removing redundancy

+ Fix mock MirSurfaceItem::orientationAngle implementation,
  mirroring what the real implementation in qtmir does.

Description of the Change

* Are there any related MPs required for this MP to build/function as expected? Please list.
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?
Not applicable

* If you changed the UI, has there been a design review?
Not applicable

To post a comment you must log in.
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2443
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1470/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/1964
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1008/console
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1008
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1008
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1990
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1924
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1924
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1924
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1915
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1915/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1915
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1915/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1915
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1915/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1915
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1915/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1915
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1915/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1915
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1915/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1915
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1915/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1915
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1915/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1915
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1915/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1470/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2444
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1473/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/1967
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1011
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1011/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1011
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1993
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1927
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1927
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1927
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1918
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1918/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1918
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1918/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1918
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1918/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1918
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1918/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1918
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1918/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1918
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1918/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1918
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1918/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1918
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1918/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1918
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1918/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1473/rebuild

review: Needs Fixing (continuous-integration)
Albert Astals Cid (aacid) wrote :

Is there a way to reproduce the bug with any of the make tryXYZ tools we have? I've been trying but couldn't figure out how to make it happen.

Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2444
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1476/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/1970
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1014
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1014
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1014
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1996
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1930
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1930
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1930
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1921/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1476/rebuild

review: Needs Fixing (continuous-integration)
Daniel d'Andrada (dandrader) wrote :

On 15/06/2016 05:54, Albert Astals Cid wrote:
> Is there a way to reproduce the bug with any of the make tryXYZ tools we have? I've been trying but couldn't figure out how to make it happen.

Sure.

- make tryOrientedShell
- Select "flo" in the Device Name drop-down list
- Unlock shell
- Drag in the launcher and click on the camera-app icon

Albert Astals Cid (aacid) wrote :

> Mir::OrientationAngle *m_orientationAngle{nullptr};

Please be consistent with the existing implementation and move it to the constructor.

review: Needs Fixing
Daniel d'Andrada (dandrader) wrote :

On 21/06/2016 09:26, Albert Astals Cid wrote:
> Review: Needs Fixing
>
>> Mir::OrientationAngle *m_orientationAngle{nullptr};
> Please be consistent with the existing implementation and move it to the constructor.

Done

Albert Astals Cid (aacid) 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.
Unstable unrelated tests, passed fine locally

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2445
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1584/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2103
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1103
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1103
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1103
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2131
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2042
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2042
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2042
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2033
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2033/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2033
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2033/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2033
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2033/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2033
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2033/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2033
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2033/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2033
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2033/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2033
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2033/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2033
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2033/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2033
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2033/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1584/rebuild

review: Needs Fixing (continuous-integration)
Albert Astals Cid (aacid) wrote :

Found a regression:
 * Be in dash in vertical orientation
 * Open Cut the rope from app scope
 * Wait until Cut the rope is animating the rectangle in the main screen
 * Change the phone to horizontal orientation
 * Do a quick swipe on the right to return to dash
 * Quickly after being in dash put the phone in vertical orientation
 * Get http://i.imgur.com/KQGUBqI.png

I can reproduce this fairly easy 2 out of 3 times with this branch and not at all without it.

review: Needs Fixing
lp:~dandrader/unity8/splashRotation updated on 2016-06-22
2493. By Daniel d'Andrada on 2016-06-22

Fix mock MirSurfaceItem::orientationAngle implementation

Mirroring what the real implementation in qtmir does.

2494. By Daniel d'Andrada on 2016-06-22

Fix splashscreen orientation when app rotates own contents

2495. By Daniel d'Andrada on 2016-06-22

Write regression test

2496. By Daniel d'Andrada on 2016-06-22

Fix regression found during code review

Daniel d'Andrada (dandrader) wrote :

> Found a regression:
> * Be in dash in vertical orientation
> * Open Cut the rope from app scope
> * Wait until Cut the rope is animating the rectangle in the main screen
> * Change the phone to horizontal orientation
> * Do a quick swipe on the right to return to dash
> * Quickly after being in dash put the phone in vertical orientation
> * Get http://i.imgur.com/KQGUBqI.png
>
> I can reproduce this fairly easy 2 out of 3 times with this branch and not at
> all without it.

Fixed, thanks.

Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2495
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1595/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2122
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1116
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1116
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1116
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2150
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2060
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2060
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2060
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2051
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2051/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2051
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2051/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2051
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2051/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2051
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2051/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2051
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2051/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2051
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2051/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2051
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2051/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2051
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2051/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2051
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2051/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1595/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2496
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1597/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/2124/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2152
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2062
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2062
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2062
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2053
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2053/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2053
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2053/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2053
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2053/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2053
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2053/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2053
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2053/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2053
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2053/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2053
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2053/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2053
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2053/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2053
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2053/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1597/rebuild

review: Needs Fixing (continuous-integration)
Albert Astals Cid (aacid) wrote :

How hard would it be to add a testcase for that last regression fix you made?

review: Needs Information
Daniel d'Andrada (dandrader) wrote :

On 23/06/2016 06:36, Albert Astals Cid wrote:
> Review: Needs Information
>
> How hard would it be to add a testcase for that last regression fix you made?

I did it already. It's
http://bazaar.launchpad.net/~dandrader/unity8/splashRotation/revision/2495

Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes, here's hoping i didn't do an incomplete testing like before :D

 * Did CI run pass? If not, please explain why.
Almost yes, the main job failed in somewhere that doesn't really matter.

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2496
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1633/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/2175/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2203
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2114
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2114
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2114
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2105
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2105/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2105
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2105/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2105
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2105/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2105
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2105/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2105
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2105/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2105/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2105
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2105/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2105
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2105/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2105
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2105/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1633/rebuild

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Stages/ApplicationWindow.qml'
2--- qml/Stages/ApplicationWindow.qml 2016-06-02 12:02:35 +0000
3+++ qml/Stages/ApplicationWindow.qml 2016-06-22 20:20:30 +0000
4@@ -46,6 +46,7 @@
5 property alias resizeSurface: surfaceContainer.resizeSurface
6 property int requestedWidth: -1
7 property int requestedHeight: -1
8+ property real splashRotation: 0
9
10 readonly property int minimumWidth: surface ? surface.minimumWidth : 0
11 readonly property int minimumHeight: surface ? surface.minimumHeight : 0
12@@ -184,6 +185,11 @@
13 backgroundColor: d.splashColor
14 headerColor: d.splashColorHeader
15 footerColor: d.splashColorFooter
16+
17+ rotation: root.splashRotation
18+ anchors.centerIn: parent
19+ width: rotation == 0 || rotation == 180 ? root.width : root.height
20+ height: rotation == 0 || rotation == 180 ? root.height : root.width
21 }
22 }
23 }
24
25=== modified file 'qml/Stages/SpreadDelegate.qml'
26--- qml/Stages/SpreadDelegate.qml 2016-06-17 01:16:36 +0000
27+++ qml/Stages/SpreadDelegate.qml 2016-06-22 20:20:30 +0000
28@@ -82,12 +82,69 @@
29
30 QtObject {
31 id: priv
32+ objectName: "spreadDelegatePriv"
33 property bool startingUp: true
34 }
35
36 Component.onCompleted: { finishStartUpTimer.start(); }
37 Timer { id: finishStartUpTimer; interval: 400; onTriggered: priv.startingUp = false }
38
39+ // JS version of QPlatformScreen::angleBetween C++ implementation.
40+ // So don't ask me how it works because I don't know.
41+ // Calling Screen.angleBetween from within a Binding component doesn't work for some reason.
42+ function angleBetween(a, b) {
43+ if (a == b)
44+ return 0;
45+
46+ var ia = Math.log(a) / Math.LN2;
47+ var ib = Math.log(b) / Math.LN2;
48+
49+ var delta = ia - ib;
50+
51+ if (delta < 0)
52+ delta = delta + 4;
53+
54+ var angles = [ 0, 90, 180, 270 ];
55+ return angles[delta];
56+ }
57+
58+ // Sets the initial orientationAngle of the window, when it first slides into view
59+ // (with the splash screen likely being displayed). At that point we just try to
60+ // match shell's current orientation. We need a bit of time in this state as the
61+ // information we need to decide orientationAngle may take a few cycles to
62+ // be set.
63+ Binding {
64+ target: appWindowWithShadow
65+ property: "orientationAngle"
66+ when: priv.startingUp
67+ value: {
68+ var supportedOrientations = root.supportedOrientations;
69+
70+ if (supportedOrientations === Qt.PrimaryOrientation) {
71+ supportedOrientations = root.orientations.primary;
72+ }
73+
74+ // If it doesn't support shell's current orientation
75+ // then simply pick some arbitraty one that it does support
76+ var chosenOrientation = 0;
77+ if (supportedOrientations & root.shellOrientation) {
78+ chosenOrientation = root.shellOrientation;
79+ } else if (supportedOrientations & Qt.PortraitOrientation) {
80+ chosenOrientation = root.orientations.portrait;
81+ } else if (supportedOrientations & Qt.LandscapeOrientation) {
82+ chosenOrientation = root.orientations.landscape;
83+ } else if (supportedOrientations & Qt.InvertedPortraitOrientation) {
84+ chosenOrientation = root.orientations.invertedPortrait;
85+ } else if (supportedOrientations & Qt.InvertedLandscapeOrientation) {
86+ chosenOrientation = root.orientations.invertedLandscape;
87+ } else {
88+ chosenOrientation = root.orientations.primary;
89+ }
90+
91+ return angleBetween(root.orientations.native_, chosenOrientation);
92+ }
93+ }
94+
95 Rectangle {
96 id: background
97 color: "black"
98@@ -129,9 +186,7 @@
99 }
100
101 state: {
102- if (priv.startingUp) {
103- return "startingUp";
104- } else if (root.application && root.application.rotatesWindowContents) {
105+ if (root.application && root.application.rotatesWindowContents) {
106 return "counterRotate";
107 } else if (orientationChangeAnimation.running) {
108 return "animatingRotation";
109@@ -149,118 +204,53 @@
110 }
111
112 states: [
113- // Sets the initial orientationAngle of the window, when it first slides into view
114- // (with the splash screen likely being displayed). At that point we just try to
115- // match shell's current orientation. We need a bit of time in this state as the
116- // information we need to decide orientationAngle may take a few cycles to
117- // be set.
118+ // A base state containing bindings common to others
119+ // Ensures appWindowWithShadow fills the root area.
120 State {
121- name: "startingUp"
122+ name: "fillRootArea"
123 PropertyChanges {
124 target: appWindowWithShadow
125 restoreEntryValues: false
126- orientationAngle: {
127- if (!root.application || root.application.rotatesWindowContents) {
128- return 0;
129- }
130-
131- var supportedOrientations = root.supportedOrientations;
132-
133- if (supportedOrientations === Qt.PrimaryOrientation) {
134- supportedOrientations = root.orientations.primary;
135- }
136-
137- // If it doesn't support shell's current orientation
138- // then simply pick some arbitraty one that it does support
139- var chosenOrientation = 0;
140- if (supportedOrientations & root.shellOrientation) {
141- chosenOrientation = root.shellOrientation;
142- } else if (supportedOrientations & Qt.PortraitOrientation) {
143- chosenOrientation = root.orientations.portrait;
144- } else if (supportedOrientations & Qt.LandscapeOrientation) {
145- chosenOrientation = root.orientations.landscape;
146- } else if (supportedOrientations & Qt.InvertedPortraitOrientation) {
147- chosenOrientation = root.orientations.invertedPortrait;
148- } else if (supportedOrientations & Qt.InvertedLandscapeOrientation) {
149- chosenOrientation = root.orientations.invertedLandscape;
150- } else {
151- chosenOrientation = root.orientations.primary;
152- }
153-
154- return Screen.angleBetween(root.orientations.native_, chosenOrientation);
155- }
156-
157- rotation: normalizeAngle(appWindowWithShadow.orientationAngle - root.shellOrientationAngle)
158- width: {
159- if (rotation == 0 || rotation == 180) {
160- return root.width;
161- } else {
162- return root.height;
163- }
164- }
165- height: {
166- if (rotation == 0 || rotation == 180)
167- return root.height;
168- else
169- return root.width;
170- }
171+ width: appWindowWithShadow.rotation == 0 || appWindowWithShadow.rotation == 180 ? root.width : root.height
172+ height: appWindowWithShadow.rotation == 0 || appWindowWithShadow.rotation == 180 ? root.height : root.width
173 }
174 },
175 // In this state we stick to our currently set orientationAngle, which may change only due
176 // to calls made to matchShellOrientation() or animateToShellOrientation()
177 State {
178- id: keepSceneRotationState
179 name: "keepSceneRotation"
180-
181- StateChangeScript { script: {
182- // break binding
183- appWindowWithShadow.orientationAngle = appWindowWithShadow.orientationAngle;
184- } }
185+ extend: "fillRootArea"
186 PropertyChanges {
187 target: appWindowWithShadow
188 restoreEntryValues: false
189 rotation: normalizeAngle(appWindowWithShadow.orientationAngle - root.shellOrientationAngle)
190- width: {
191- if (rotation == 0 || rotation == 180) {
192- return root.width;
193- } else {
194- return root.height;
195- }
196- }
197- height: {
198- if (rotation == 0 || rotation == 180)
199- return root.height;
200- else
201- return root.width;
202- }
203 }
204 },
205 // In this state we counteract any shell rotation so that the window, in scene coordinates,
206 // remains unrotated.
207+ // But the splash screen should still obey the set orientationAngle set by shell
208 State {
209 name: "counterRotate"
210- StateChangeScript { script: {
211- // break binding
212- appWindowWithShadow.orientationAngle = appWindowWithShadow.orientationAngle;
213- } }
214+ extend: "fillRootArea"
215 PropertyChanges {
216 target: appWindowWithShadow
217- width: root.shellOrientationAngle == 0 || root.shellOrientationAngle == 180 ? root.width : root.height
218- height: root.shellOrientationAngle == 0 || root.shellOrientationAngle == 180 ? root.height : root.width
219 rotation: normalizeAngle(-root.shellOrientationAngle)
220 }
221 PropertyChanges {
222 target: appWindow
223 surfaceOrientationAngle: appWindowWithShadow.orientationAngle
224+ splashRotation: appWindowWithShadow.orientationAngle
225 }
226 },
227+ // Dummy state.
228+ // The animation may indiscriminately break any bindings assigned to appWindowWithShadow rotation,
229+ // width or height.
230 State {
231 name: "animatingRotation"
232 }
233 ]
234
235- x: (parent.width - width) / 2
236- y: (parent.height - height) / 2
237+ anchors.centerIn: parent
238
239 BorderImage {
240 anchors {
241
242=== modified file 'tests/mocks/Unity/Application/MirSurfaceItem.cpp'
243--- tests/mocks/Unity/Application/MirSurfaceItem.cpp 2016-05-26 13:15:35 +0000
244+++ tests/mocks/Unity/Application/MirSurfaceItem.cpp 2016-06-22 20:20:30 +0000
245@@ -43,6 +43,7 @@
246 , m_qmlContentComponent(nullptr)
247 , m_qmlItem(nullptr)
248 , m_consumesInput(false)
249+ , m_orientationAngle(nullptr)
250 , m_surfaceWidth(0)
251 , m_surfaceHeight(0)
252 , m_touchPressCount(0)
253@@ -68,6 +69,7 @@
254 {
255 DEBUG_MSG((void*)(this) << name());
256 setSurface(nullptr);
257+ delete m_orientationAngle;
258 }
259
260 void MirSurfaceItem::printComponentErrors()
261@@ -125,7 +127,10 @@
262
263 Mir::OrientationAngle MirSurfaceItem::orientationAngle() const
264 {
265- if (m_qmlSurface) {
266+ if (m_orientationAngle) {
267+ Q_ASSERT(!m_qmlSurface);
268+ return *m_orientationAngle;
269+ } else if (m_qmlSurface) {
270 return m_qmlSurface->orientationAngle();
271 } else {
272 return Mir::Angle0;
273@@ -134,16 +139,24 @@
274
275 void MirSurfaceItem::setOrientationAngle(Mir::OrientationAngle angle)
276 {
277- if (!m_qmlSurface)
278- return;
279-
280- if (m_qmlSurface->orientationAngle() == angle)
281- return;
282-
283- m_qmlSurface->setOrientationAngle(angle);
284-
285- QQmlProperty orientationProp(m_qmlItem, "orientationAngle");
286- orientationProp.write(QVariant::fromValue(m_qmlSurface->orientationAngle()));
287+ DEBUG_MSG(angle);
288+
289+ if (m_qmlSurface) {
290+ Q_ASSERT(!m_orientationAngle);
291+ m_qmlSurface->setOrientationAngle(angle);
292+ } else if (!m_orientationAngle) {
293+ m_orientationAngle = new Mir::OrientationAngle;
294+ *m_orientationAngle = angle;
295+ Q_EMIT orientationAngleChanged(angle);
296+ } else if (*m_orientationAngle != angle) {
297+ *m_orientationAngle = angle;
298+ Q_EMIT orientationAngleChanged(angle);
299+ }
300+
301+ if (m_qmlItem) {
302+ QQmlProperty orientationProp(m_qmlItem, "orientationAngle");
303+ orientationProp.write(QVariant::fromValue(orientationAngle()));
304+ }
305 }
306
307 void MirSurfaceItem::updateScreenshot(QUrl screenshotUrl)
308@@ -175,6 +188,11 @@
309 QQmlProperty screenshotSource(m_qmlItem, "screenshotSource");
310 screenshotSource.write(QVariant::fromValue(m_qmlSurface->screenshotUrl()));
311 }
312+
313+ {
314+ QQmlProperty orientationProp(m_qmlItem, "orientationAngle");
315+ orientationProp.write(QVariant::fromValue(orientationAngle()));
316+ }
317 }
318
319 void MirSurfaceItem::touchEvent(QTouchEvent * event)
320@@ -255,7 +273,16 @@
321 updateSurfaceSize();
322 updateMirSurfaceVisibility();
323
324- connect(m_qmlSurface, &MirSurface::orientationAngleChanged, this, &MirSurfaceItem::orientationAngleChanged);
325+ if (m_orientationAngle) {
326+ m_qmlSurface->setOrientationAngle(*m_orientationAngle);
327+ connect(m_qmlSurface, &MirSurfaceInterface::orientationAngleChanged, this, &MirSurfaceItem::orientationAngleChanged);
328+ delete m_orientationAngle;
329+ m_orientationAngle = nullptr;
330+ } else {
331+ connect(m_qmlSurface, &MirSurfaceInterface::orientationAngleChanged, this, &MirSurfaceItem::orientationAngleChanged);
332+ Q_EMIT orientationAngleChanged(m_qmlSurface->orientationAngle());
333+ }
334+
335 connect(m_qmlSurface, &MirSurface::screenshotUrlChanged, this, &MirSurfaceItem::updateScreenshot);
336 connect(m_qmlSurface, &MirSurface::liveChanged, this, &MirSurfaceItem::liveChanged);
337 connect(m_qmlSurface, &MirSurface::stateChanged, this, &MirSurfaceItem::surfaceStateChanged);
338
339=== modified file 'tests/mocks/Unity/Application/MirSurfaceItem.h'
340--- tests/mocks/Unity/Application/MirSurfaceItem.h 2016-05-09 08:54:11 +0000
341+++ tests/mocks/Unity/Application/MirSurfaceItem.h 2016-06-22 20:20:30 +0000
342@@ -117,6 +117,8 @@
343
344 bool m_consumesInput;
345
346+ Mir::OrientationAngle *m_orientationAngle;
347+
348 int m_surfaceWidth;
349 int m_surfaceHeight;
350
351
352=== modified file 'tests/qmltests/Stages/tst_SpreadDelegate.qml'
353--- tests/qmltests/Stages/tst_SpreadDelegate.qml 2016-04-08 18:30:34 +0000
354+++ tests/qmltests/Stages/tst_SpreadDelegate.qml 2016-06-22 20:20:30 +0000
355@@ -1,5 +1,5 @@
356 /*
357- * Copyright 2014-2015 Canonical Ltd.
358+ * Copyright 2014-2016 Canonical Ltd.
359 *
360 * This program is free software; you can redistribute it and/or modify
361 * it under the terms of the GNU General Public License as published by
362@@ -132,10 +132,12 @@
363 property int value: selectedIndex * 90
364 }
365 Button {
366+ id: matchShellButton
367 text: "matchShellOrientation()"
368 onClicked: { spreadDelegateLoader.item.matchShellOrientation(); }
369 }
370 Button {
371+ id: animateToShellButton
372 text: "animateToShellOrientation()"
373 onClicked: { spreadDelegateLoader.item.animateToShellOrientation(); }
374 }
375@@ -197,6 +199,77 @@
376
377 }
378
379+ function waitUntilAppWindowIsFullyLoaded() {
380+ var appWindowStateGroup = findInvisibleChild(spreadDelegate, "applicationWindowStateGroup");
381+ tryCompareFunction(function() { return appWindowStateGroup.state === "surface" }, true);
382+ waitUntilTransitionsEnd(appWindowStateGroup);
383+
384+ var priv = findInvisibleChild(spreadDelegate, "spreadDelegatePriv");
385+ verify(priv);
386+ tryCompare(priv, "startingUp", false);
387+ }
388+
389+ function rotateShellTo(angle) {
390+ shellOrientationAngleSelector.selectedIndex = angle / 90;
391+ }
392+
393+ function waitUntilRotationAnimationStops() {
394+ var orientationChangeAnimation = findInvisibleChild(spreadDelegate, "orientationChangeAnimation");
395+ verify(orientationChangeAnimation);
396+ tryCompare(orientationChangeAnimation, "running", false);
397+ }
398+
399+ function checkAppWindowTransformationMatchesRotation(appWindow, angle) {
400+
401+ var topLeftX = 0;
402+ var topLeftY = 0;
403+ var bottomRightX = 0;
404+ var bottomRightY = 0;
405+
406+ switch (angle) {
407+ case 0:
408+ topLeftX = 0;
409+ topLeftY = 0;
410+ bottomRightX = fakeShell.shortestDimension;
411+ bottomRightY = fakeShell.longestDimension;
412+ break;
413+ case 90:
414+ topLeftX = fakeShell.shortestDimension;
415+ topLeftY = 0;
416+ bottomRightX = 0;
417+ bottomRightY = fakeShell.longestDimension;
418+ break;
419+ default:
420+ // TODO implement 180 and 270 once we need them
421+ verify(false);
422+ }
423+
424+ var appWindowTopLeftInRootCoords = appWindow.mapToItem(root, 0, 0);
425+
426+ if (appWindowTopLeftInRootCoords.x !== topLeftX) {
427+ qtest_fail("appWindow topLeft.x ("+appWindowTopLeftInRootCoords.x+")"
428+ +" doesn't match expectations ("+topLeftX+").", 1);
429+ }
430+ if (appWindowTopLeftInRootCoords.y !== topLeftY) {
431+ qtest_fail("appWindow topLeft.y ("+appWindowTopLeftInRootCoords.y+")"
432+ +" doesn't match expectations ("+topLeftY+").", 1);
433+ }
434+
435+ var appWindowBottomRightInRootCoords = appWindow.mapToItem(root, appWindow.width,
436+ appWindow.height);
437+ compare(appWindowBottomRightInRootCoords.x, bottomRightX);
438+ compare(appWindowBottomRightInRootCoords.y, bottomRightY);
439+
440+ if (appWindowBottomRightInRootCoords.x !== bottomRightX) {
441+ qtest_fail("appWindow bottomRight.x ("+appWindowBottomRightInRootCoords.x+")"
442+ +" doesn't match expectations ("+bottomRightX+").", 1);
443+ }
444+ if (appWindowBottomRightInRootCoords.y !== bottomRightY) {
445+ qtest_fail("appWindow bottomRight.y ("+appWindowBottomRightInRootCoords.y+")"
446+ +" doesn't match expectations ("+bottomRightY+").", 1);
447+ }
448+ }
449+
450 function test_swipeToClose_data() {
451 return [
452 {tag: "swipeToClose=true closeable=true -> appWindow moves away",
453@@ -278,12 +351,12 @@
454 function test_keepsSceneTransformationWhenShellRotates(data) {
455 loadWithGalleryApp.clicked();
456
457+ waitUntilAppWindowIsFullyLoaded();
458+
459 var appWindowWithShadow = findChild(spreadDelegate, "appWindowWithShadow");
460 verify(appWindowWithShadow);
461
462- // Wait until it reaches the state we are interested on.
463- // It begins with "startingUp"
464- tryCompare(appWindowWithShadow, "state", "keepSceneRotation");
465+ compare(appWindowWithShadow.state, "keepSceneRotation");
466
467 shellOrientationAngleSelector.selectedIndex = data.selectedIndex;
468
469@@ -293,14 +366,7 @@
470
471
472 // and scene transformation must be the identity (ie, no rotation or translation)
473- var pointInDelegateCoords = appWindowWithShadow.mapToItem(root, 0, 0);
474- compare(pointInDelegateCoords.x, 0);
475- compare(pointInDelegateCoords.y, 0);
476-
477- pointInDelegateCoords = appWindowWithShadow.mapToItem(root,
478- fakeShell.shortestDimension, fakeShell.longestDimension);
479- compare(pointInDelegateCoords.x, fakeShell.shortestDimension);
480- compare(pointInDelegateCoords.y, fakeShell.longestDimension);
481+ checkAppWindowTransformationMatchesRotation(appWindowWithShadow, 0);
482 }
483
484 function waitForCloseAnimationToFinish() {
485@@ -316,5 +382,42 @@
486 spreadDelegateLoader.item.highlightShown = true;
487 tryCompare(highlightRect, "visible", true)
488 }
489+
490+ /*
491+ Checks that the ApplicationWindow position, size and rotation is correct after
492+ a sequence of shell rotations folowed by rotations (immediate or not) to match them
493+ */
494+ function test_animateToShellThenMatchShell() {
495+ loadWithGalleryApp.clicked();
496+ waitUntilAppWindowIsFullyLoaded();
497+
498+ var appWindowWithShadow = findChild(spreadDelegate, "appWindowWithShadow");
499+ verify(appWindowWithShadow);
500+
501+ // appWindow transformation is 0 relative to display
502+ checkAppWindowTransformationMatchesRotation(appWindowWithShadow, 0);
503+
504+ rotateShellTo(90);
505+
506+ // appWindow transformation remains 0 relative to display
507+ checkAppWindowTransformationMatchesRotation(appWindowWithShadow, 0);
508+
509+ animateToShellButton.clicked();
510+ waitUntilRotationAnimationStops();
511+
512+ // appWindow transformation is now 90 relative to display, just like shell
513+ checkAppWindowTransformationMatchesRotation(appWindowWithShadow, 90);
514+
515+ rotateShellTo(0);
516+
517+ // appWindow transformation is remains 90 relative to display.
518+ checkAppWindowTransformationMatchesRotation(appWindowWithShadow, 90);
519+
520+ matchShellButton.clicked();
521+
522+ // appWindow transformation is back to 0 relative to display, just like shell
523+ checkAppWindowTransformationMatchesRotation(appWindowWithShadow, 0);
524+
525+ }
526 }
527 }

Subscribers

People subscribed via source and target branches