~dandrader/unity8/miral

« back to all changes in this revision

Viewing changes to tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt

  • Committer: CI Train Bot
  • Author(s): Michael Terry
  • Date: 2015-11-12 20:39:05 UTC
  • mfrom: (2004.5.2 async)
  • Revision ID: ci-train-bot@canonical.com-20151112203905-tdbo0utd7jcrqw00
Make a few DBus calls asynchronous, for a smoother UX.

The calls I've changed here are neither hugely important nor frequent calls. But every little bit helps.

- Made a few sync calls async.

- Made a few sync calls more obviously sync. We had several instances of asyncCall()'s return value -- a QDBusPendingReply -- being assigned to a QDBusReply variable, which makes it wait for the call to finish. In cases where it didn't make sense to rewrite logic to be async, I've merely changed the method to be call() instead of asyncCall() for clarity.

- I removed the API in our AccountsService plugin for even making sync calls. This won't stop future developers from from writing sync code, but might give them pause.

- I removed some test mocks for our AccountsService plugin interface and changed those tests to use our actual AS plugin against a mock AS server. In truth, this change was because I had a devil of a time crafting a fake reply that included a custom complex type. But it's a good change anyway. Exercises more of our code in tests and reduces duplicated interfaces.
Approved by: Albert Astals Cid

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
include_directories(
4
4
    ${CMAKE_CURRENT_SOURCE_DIR}
5
5
    ${CMAKE_CURRENT_BINARY_DIR}
 
6
    ${CMAKE_SOURCE_DIR}/plugins/AccountsService
6
7
    ${CMAKE_SOURCE_DIR}/plugins/Greeter/Unity/Launcher
7
8
    ${libunity8-private_SOURCE_DIR}
8
9
    )
14
15
### LauncherModelASTest
15
16
add_executable(launchermodelastestExec
16
17
    launchermodelastest.cpp
17
 
    AccountsServiceDBusAdaptor.cpp
 
18
    ${CMAKE_SOURCE_DIR}/plugins/AccountsService/AccountsServiceDBusAdaptor.cpp
18
19
    ${CMAKE_SOURCE_DIR}/plugins/Greeter/Unity/Launcher/launchermodelas.cpp
19
20
    ${CMAKE_SOURCE_DIR}/plugins/Greeter/Unity/Launcher/launcheritem.cpp
20
21
    ${CMAKE_SOURCE_DIR}/plugins/Greeter/Unity/Launcher/quicklistmodel.cpp
29
30
    unity8-private
30
31
    ${GSETTINGS_QT_LDFLAGS}
31
32
    )
 
33
add_dependencies(launchermodelastestExec mock-server)
32
34
qt5_use_modules(launchermodelastestExec Test Core DBus Gui)
33
35
add_unity8_unittest(LauncherModelAS dbus-test-runner
34
36
    ARG_PREFIX "--parameter"
35
 
    ARGS --task $<TARGET_FILE:launchermodelastestExec>
 
37
    ARGS
 
38
        --task $<TARGET_FILE:mock-server>
 
39
        --ignore-return
 
40
        --task $<TARGET_FILE:launchermodelastestExec>
 
41
        --wait-for org.freedesktop.Accounts
36
42
)
37
43
 
38
44
# copy .desktop files into build directory for shadow builds