diff options
-rw-r--r-- | tests/teststore.cpp | 8 | ||||
-rw-r--r-- | tests/teststore.h | 1 | ||||
-rw-r--r-- | views/accounts/tests/tst_accountsview.qml | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/teststore.cpp b/tests/teststore.cpp index 71b19499..c69588ef 100644 --- a/tests/teststore.cpp +++ b/tests/teststore.cpp | |||
@@ -243,6 +243,14 @@ void TestStore::setup(const QVariantMap &map) | |||
243 | Sink::ResourceControl::flushMessageQueue(resources).exec().waitForFinished(); | 243 | Sink::ResourceControl::flushMessageQueue(resources).exec().waitForFinished(); |
244 | } | 244 | } |
245 | 245 | ||
246 | void TestStore::shutdownResources() | ||
247 | { | ||
248 | const auto resources = Sink::Store::read<Sink::ApplicationDomain::SinkResource>({}); | ||
249 | for (const auto &resource : resources) { | ||
250 | Sink::ResourceControl::shutdown(resource.identifier()).exec().waitForFinished(); | ||
251 | } | ||
252 | } | ||
253 | |||
246 | QVariant TestStore::load(const QByteArray &type, const QVariantMap &filter) | 254 | QVariant TestStore::load(const QByteArray &type, const QVariantMap &filter) |
247 | { | 255 | { |
248 | using namespace Sink::ApplicationDomain; | 256 | using namespace Sink::ApplicationDomain; |
diff --git a/tests/teststore.h b/tests/teststore.h index 1a6a2563..4d5359a7 100644 --- a/tests/teststore.h +++ b/tests/teststore.h | |||
@@ -27,6 +27,7 @@ class TestStore : public QObject { | |||
27 | Q_OBJECT | 27 | Q_OBJECT |
28 | public: | 28 | public: |
29 | Q_INVOKABLE void setup(const QVariantMap &); | 29 | Q_INVOKABLE void setup(const QVariantMap &); |
30 | Q_INVOKABLE void shutdownResources(); | ||
30 | Q_INVOKABLE QVariant load(const QByteArray &type, const QVariantMap &); | 31 | Q_INVOKABLE QVariant load(const QByteArray &type, const QVariantMap &); |
31 | Q_INVOKABLE QVariantList loadList(const QByteArray &type, const QVariantMap &); | 32 | Q_INVOKABLE QVariantList loadList(const QByteArray &type, const QVariantMap &); |
32 | Q_INVOKABLE QVariantMap read(const QVariant &); | 33 | Q_INVOKABLE QVariantMap read(const QVariant &); |
diff --git a/views/accounts/tests/tst_accountsview.qml b/views/accounts/tests/tst_accountsview.qml index c3b919c0..8d7bc29d 100644 --- a/views/accounts/tests/tst_accountsview.qml +++ b/views/accounts/tests/tst_accountsview.qml | |||
@@ -29,6 +29,10 @@ TestCase { | |||
29 | name: "AccountsView" | 29 | name: "AccountsView" |
30 | when: windowShown | 30 | when: windowShown |
31 | 31 | ||
32 | function cleanup() { | ||
33 | TestStore.shutdownResources(); | ||
34 | } | ||
35 | |||
32 | function visitChildren(item) { | 36 | function visitChildren(item) { |
33 | console.warn(item) | 37 | console.warn(item) |
34 | for (var i = 0; i < item.children.length; i++) { | 38 | for (var i = 0; i < item.children.length; i++) { |