Merge lp://staging/~dandrader/qtmir/fake-apps into lp://staging/qtmir
- fake-apps
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp://staging/~dandrader/qtmir/fake-apps |
Merge into: | lp://staging/qtmir |
Prerequisite: | lp://staging/~dandrader/qtmir/dontPassArgsToMir |
Diff against target: |
4643 lines (+3782/-59) 47 files modified
CMakeLists.txt (+3/-2) debian/control (+3/-2) debian/gles-patches/convert-to-gles.patch (+1/-1) src/common/debughelpers.cpp (+47/-1) src/common/debughelpers.h (+3/-1) src/common/mirserverinterface.h (+46/-0) src/modules/Unity/Application/CMakeLists.txt (+10/-0) src/modules/Unity/Application/application.cpp (+1/-1) src/modules/Unity/Application/application.h (+0/-1) src/modules/Unity/Application/application_manager.cpp (+14/-4) src/modules/Unity/Application/fake/fakeapplicationinfo.cpp (+26/-0) src/modules/Unity/Application/fake/fakeapplicationinfo.h (+93/-0) src/modules/Unity/Application/fake/fakemaliit.cpp (+76/-0) src/modules/Unity/Application/fake/fakemaliit.h (+47/-0) src/modules/Unity/Application/fake/fakemirclient.cpp (+682/-0) src/modules/Unity/Application/fake/fakemirclient.h (+179/-0) src/modules/Unity/Application/fake/fakeprompt.cpp (+317/-0) src/modules/Unity/Application/fake/fakeprompt.h (+157/-0) src/modules/Unity/Application/fake/faketaskcontroller.cpp (+676/-0) src/modules/Unity/Application/fake/faketaskcontroller.h (+157/-0) src/modules/Unity/Application/fake/windowattributes.h (+47/-0) src/modules/Unity/Application/mirtestsingleton.cpp (+211/-0) src/modules/Unity/Application/mirtestsingleton.h (+116/-0) src/modules/Unity/Application/plugin.cpp (+11/-1) src/modules/Unity/Application/resources/screenshots/gmail-webapp.svg (+343/-0) src/modules/Unity/Application/resources/screenshots/ubuntu-weather-app.svg (+201/-0) src/modules/Unity/Application/resources/surfaces.qrc (+39/-0) src/modules/Unity/Application/taskcontroller.cpp (+11/-0) src/modules/Unity/Application/taskcontroller.h (+12/-5) src/platforms/mirserver/CMakeLists.txt (+1/-0) src/platforms/mirserver/cursor.cpp (+5/-4) src/platforms/mirserver/cursor.h (+2/-2) src/platforms/mirserver/logging.cpp (+2/-1) src/platforms/mirserver/logging.h (+2/-1) src/platforms/mirserver/mirserverhooks.cpp (+9/-1) src/platforms/mirserver/mirserverhooks.h (+2/-1) src/platforms/mirserver/mirsingleton.cpp (+29/-1) src/platforms/mirserver/mirsingleton.h (+8/-1) src/platforms/mirserver/pidfetcher.cpp (+34/-0) src/platforms/mirserver/pidfetcher.h (+43/-0) src/platforms/mirserver/qmirserver.cpp (+2/-0) src/platforms/mirserver/qmirserver_p.cpp (+31/-0) src/platforms/mirserver/qmirserver_p.h (+10/-1) src/platforms/mirserver/qteventfeeder.cpp (+63/-23) src/platforms/mirserver/qteventfeeder.h (+4/-0) src/platforms/mirserver/windowmanagementpolicy.cpp (+3/-1) tests/framework/mock_renderable.h (+3/-3) |
To merge this branch: | bzr merge lp://staging/~dandrader/qtmir/fake-apps |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Albert Astals Cid (community) | Needs Fixing | ||
Unity8 CI Bot (community) | continuous-integration | Needs Fixing | |
Gerry Boland (community) | Approve | ||
Review via email: mp+317312@code.staging.launchpad.net |
This proposal supersedes a proposal from 2017-02-14.
Commit message
Fake applications using internal mir clients when UNITY_TESTING is defined
Description of the change
Prereq-archive: ppa:ci-
* Are there any related MPs required for this MP to build/function as expected? Please list.
https:/
https:/
* 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
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:597
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
=== modified file 'src/common/
+ virtual void modify(const miral::Window &window, miral::
This is opening large functionality to the shell, which makes me suspicious. Digging I see it only used by MirSurface:
I dislike that, as shell should not be updating MirAL's information on surface min/max/inc limits, instead it should be the client (like it will happen in reality).
Can you redo the min/max/inc limit setting to use the client api instead, and remove this change?
=== modified file 'src/modules/
+ taskController.
+ procInfo = fakeTaskControl
reset too, for consistency
=== modified file 'src/modules/
+ SessionInterface *findSession(const mir::scene:
+ Application* findApplication
so these you've made public, but are also just for test use. Do comment about that fact then, just to make it clear.
Also, we need to avoid exposing mirserver apis and use MirAL's api instead. So use miral::Application instead of std::shared_
+ void onSessionStarti
is this fixing a bug? If so, would be good to separate that bug fix into a separate MP with a test.
I'll look at the Fake stuff last.
=== modified file 'src/modules/
+ Q_PROPERTY(int width READ width NOTIFY widthChanged)
+ Q_PROPERTY(int height READ height NOTIFY heightChanged)
why? size() gives this info out, and a single change signal too. You know I disapprove of this.
+ // Whether there's a MirSurfaceItem with active focus displaying this surface.
+ // This information is useful in shell tests
+ Q_PROPERTY(bool activeFocus READ activeFocus NOTIFY activeFocusChanged)
+
+ // Whether the MirSurface is exposed (true) or occluded (false)
+ // This information is useful in shell tests
+ Q_PROPERTY(bool exposed READ exposed NOTIFY exposedChanged)
Can you expose the client API for these? Wiring it through shell, you're missing out on testing the Mir->client communication.
+ // Used only by shell tests
+ Q_INVOKABLE void setMinimumWidth
+ Q_INVOKABLE void setMaximumWidth
+ Q_INVOKABLE void setMinimumHeigh
+ Q_INVOKABLE void setMaximumHeigh
+ Q_INVOKABLE void setWidthIncreme
+ Q_INVOKABLE void setHeightIncrem
Yeah as I said above, I dislike these here.
=== modified file 'src/modules/
What is going on here? What is this mouse & touch counting stuff for? Can't these things could be done in the client, and avoid the test code in the shell?
=== modified file 'src/modules/
+ const bool focusedBefore = focused();
and on.
Are you fixing a bug here? Can you separate that out into a separate MP with a test?
+ for (int i = 0; i < m_closingSurfac
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
=== modified file 'src/platforms/
+ mir::Server *server() const;
You need to justify this. Again it is exposing mir server api, which we're trying to avoid.
=== modified file 'src/platforms/
-MirServerInteg
+MirServerInteg
Why?? This prevents Mir from processing any command line args. You really need to justify this reversal.
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
On 09/02/2017 14:17, Gerry Boland wrote:
> === modified file 'src/modules/
> What is going on here? What is this mouse & touch counting stuff for? Can't these things could be done in the client, and avoid the test code in the shell?
That would be lovely. Any suggestions?
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
On 09/02/2017 14:17, Gerry Boland wrote:
> + for (int i = 0; i < m_closingSurfac
> foreach nicer
That's debatable. I personally find Q_FOREACH to be an eyesore.
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
Instead of exporting the whole of MirServer through the QPA, would be cleaner if you could just expose the bare minimum api needed for the test bits
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
Can you also split the SessionManager-
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
> On 09/02/2017 14:17, Gerry Boland wrote:
> > + for (int i = 0; i < m_closingSurfac
> > foreach nicer
>
> That's debatable. I personally find Q_FOREACH to be an eyesore.
I mis-spoke, I meant the C++11 ranged for is nicer.
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
> On 09/02/2017 14:17, Gerry Boland wrote:
> > === modified file 'src/modules/
> > What is going on here? What is this mouse & touch counting stuff for? Can't
> these things could be done in the client, and avoid the test code in the
> shell?
>
> That would be lovely. Any suggestions?
Well I see the fake MirClient:
I don't mind if the code isn't perfect first time, I understand that shortcuts need to be made for brevity. If you mention that limitations in the description and justify why, then I'll be happy and can review with that in mind. But if not, I will point them out and ask why.
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
=== added file 'src/modules/
+ MirBufferStream* buffer_stream = mir_window_
+ // TODO sometimes buffer_stream is nullptr
+ // (Only observed when creating a lot of clients at once)
Just FYI, this is a deprecated method. The null thing is weird, I'd suggest logging a bug but if it is to be deprecated anyway, not worth the trouble.
+ for (int i = 0; i < m_windows.count(); ++i) {
+ MirWindow *window = m_windows[i];
ranged for a little nicer! It's not an eyesore IMO
=== added file 'src/modules/
+ MirClientEvent(
+ : QEvent(type), window(window), mirEvent(event) {
+ mirEvent = mir_event_
you're setting mirEvent twice afaics.
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
On 10/02/2017 11:53, Gerry Boland wrote:
> === added file 'src/modules/
> + MirBufferStream* buffer_stream = mir_window_
> + // TODO sometimes buffer_stream is nullptr
> + // (Only observed when creating a lot of clients at once)
> Just FYI, this is a deprecated method. The null thing is weird, I'd suggest logging a bug but if it is to be deprecated anyway, not worth the trouble.
That's copy-pasted code from alan_g in miral.
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:599
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:600
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:601
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:602
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:603
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:604
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:605
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
On 09/02/2017 14:17, Gerry Boland wrote:
> Review: Needs Fixing
>
> === modified file 'src/common/
> + virtual void modify(const miral::Window &window, miral::
> This is opening large functionality to the shell, which makes me suspicious. Digging I see it only used by MirSurface:
>
> I dislike that, as shell should not be updating MirAL's information on surface min/max/inc limits, instead it should be the client (like it will happen in reality).
>
> Can you redo the min/max/inc limit setting to use the client api instead, and remove this change?
Done.
> === modified file 'src/modules/
> + taskController.
> + procInfo = fakeTaskControl
> reset too, for consistency
>
Can't do that. fakeTaskControl
> === modified file 'src/modules/
> + SessionInterface *findSession(const mir::scene:
> + Application* findApplication
> so these you've made public, but are also just for test use. Do comment about that fact then, just to make it clear.
ApplicationMana
SessionManager is gone and its responsibilities split between
TaskController (most of it), SurfaceManager (just a little bit) and
ApplicationManager (another tiny piece).
Made findApplication
outside earlier in the development but not anymore).
> Also, we need to avoid exposing mirserver apis and use MirAL's api instead. So use miral::Application instead of std::shared_
findSession() is needed as explained above.
> + void onSessionStarti
> is this fixing a bug? If so, would be good to separate that bug fix into a separate MP with a test.
No. Again, it's because of the removal of SessionManager.
> === modified file 'src/modules/
> + Q_PROPERTY(int width READ width NOTIFY widthChanged)
> + Q_PROPERTY(int height READ height NOTIFY heightChanged)
> why? size() gives this info out, and a single change signal too. You know I disapprove of this.
Because test code uses it. Easier to copy/paste that from the mock
Unity.Application than to change test code.
Anyway, removed.
> + // Whether there's a MirSurfaceItem with active focus displaying this surface.
> + // This information is useful in shell tests
> + Q_PROPERTY(bool activeFocus READ activeFocus NOTIFY activeFocusChanged)
> +
> + // Whether the MirSurface is exposed (true) or occluded (false)
> + // This information is useful in shell tests
> + Q_PROPERTY(bool exposed READ exposed NOTIFY exposedChanged)
> Can you expose the client API for these? Wiring it through shell, you're missing out on testing the Mir->client communication.
Done.
> + // Used only by shell tests
> + Q_INVOKA...
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
On 10/02/2017 11:35, Gerry Boland wrote:
>> On 09/02/2017 14:17, Gerry Boland wrote:
>>> === modified file 'src/modules/
>>> What is going on here? What is this mouse & touch counting stuff for? Can't
>> these things could be done in the client, and avoid the test code in the
>> shell?
>>
>> That would be lovely. Any suggestions?
> Well I see the fake MirClient:
Done.
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:605
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
On 09/02/2017 16:26, Gerry Boland wrote:
> Can you also split the SessionManager-
Done:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:598
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
On 09/02/2017 15:20, Gerry Boland wrote:
> Instead of exporting the whole of MirServer through the QPA, would be cleaner if you could just expose the bare minimum api needed for the test bits
Would it be ok if Unity.Application module got its hands on MirServer
via other means than Qt's NativeInterface? Is the problem that MirServer
is on the NativeInterface and so shell code could access it?
I'm a bit lost here. Not sure where you wanna get to and why. The
internal mir client code is really plain mir and miral has no part in it.
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
On 09/02/2017 14:23, Gerry Boland wrote:
> === modified file 'src/platforms/
> -MirServerInteg
> +MirServerInteg
> Why?? This prevents Mir from processing any command line args. You really need to justify this reversal.
Yes, I meant to ask about it but ended up forgetting to do so due to the
sea of code and multitude of weeks that took to me make these branches.
The problem is, if I recall correctly, that Mir is getting in the way
when qtmir is used in uqmlscene (make tryFoo) and qmltestrunner (make
testFoo). That was the simplest solution. Please advise.
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:599
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal | # |
On 10/02/2017 11:53, Gerry Boland wrote:
> + for (int i = 0; i < m_windows.count(); ++i) {
> + MirWindow *window = m_windows[i];
> ranged for a little nicer! It's not an eyesore IMO
Done.
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:601
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Gerry Boland (gerboland) wrote : | # |
Only niggle is updating copyright years to 2017, for fakeapplication
Rest of the code looks good. I need to rebuild everything to check the unity8 tests again
Daniel d'Andrada (dandrader) wrote : | # |
On 16/02/2017 10:16, Gerry Boland wrote:
> Review: Approve code
>
> Only niggle is updating copyright years to 2017, for fakeapplication
Done.
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:602
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:603
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Gerry Boland (gerboland) wrote : | # |
Yep, still good
Gerry Boland (gerboland) wrote : | # |
Looks unchanged
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:610
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Albert Astals Cid (aacid) wrote : | # |
Text conflict in debian/control
Text conflict in src/platforms/
2 conflicts encountered.
Was already top approved.
Unmerged revisions
- 610. By Daniel d'Andrada
-
Fake applications using internal mir clients when UNITY_TESTING is defined
FAILED: Continuous integration, rev:596 /unity8- jenkins. ubuntu. com/job/ lp-qtmir- ci/485/ /unity8- jenkins. ubuntu. com/job/ build/4058/ console /unity8- jenkins. ubuntu. com/job/ build-0- fetch/4086 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 3926/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= zesty/3926/ console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 3926/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= zesty/3926/ console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 3926/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= zesty/3926/ console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-qtmir- ci/485/ rebuild
https:/