diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-24 22:15:18 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-24 22:15:18 +0100 |
commit | 9ea268a6d0f4054c31b2729ecd6cfcc9d07a2d6a (patch) | |
tree | 41fef7daac9e5ae64d61452a3f38c82243d29fdd /tests/dummyresourcetest.cpp | |
parent | 84d70933c0cd0987d5fee5a78f413fec82bb1288 (diff) | |
download | sink-9ea268a6d0f4054c31b2729ecd6cfcc9d07a2d6a.tar.gz sink-9ea268a6d0f4054c31b2729ecd6cfcc9d07a2d6a.zip |
Implemented notification support in the model.
This will allow us to fold things like progress and sync status directly
into the model. Usecases are mail download progress and folder sync
progress.
Ideally we would also solve the resource/account state through this.
Diffstat (limited to 'tests/dummyresourcetest.cpp')
-rw-r--r-- | tests/dummyresourcetest.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/dummyresourcetest.cpp b/tests/dummyresourcetest.cpp index eea63c0..17df160 100644 --- a/tests/dummyresourcetest.cpp +++ b/tests/dummyresourcetest.cpp | |||
@@ -136,12 +136,7 @@ private slots: | |||
136 | void testResourceSync() | 136 | void testResourceSync() |
137 | { | 137 | { |
138 | ::DummyResource resource(getContext()); | 138 | ::DummyResource resource(getContext()); |
139 | auto job = resource.synchronizeWithSource(Sink::QueryBase()); | 139 | VERIFYEXEC(resource.synchronizeWithSource(Sink::QueryBase())); |
140 | // TODO pass in optional timeout? | ||
141 | auto future = job.exec(); | ||
142 | future.waitForFinished(); | ||
143 | QVERIFY(!future.errorCode()); | ||
144 | QVERIFY(future.isFinished()); | ||
145 | QVERIFY(!resource.error()); | 140 | QVERIFY(!resource.error()); |
146 | auto processAllMessagesFuture = resource.processAllMessages().exec(); | 141 | auto processAllMessagesFuture = resource.processAllMessages().exec(); |
147 | processAllMessagesFuture.waitForFinished(); | 142 | processAllMessagesFuture.waitForFinished(); |
@@ -152,7 +147,7 @@ private slots: | |||
152 | const auto query = Query().resourceFilter("sink.dummy.instance1"); | 147 | const auto query = Query().resourceFilter("sink.dummy.instance1"); |
153 | 148 | ||
154 | // Ensure all local data is processed | 149 | // Ensure all local data is processed |
155 | Sink::Store::synchronize(query).exec().waitForFinished(); | 150 | VERIFYEXEC(Sink::Store::synchronize(query)); |
156 | VERIFYEXEC(Sink::ResourceControl::flushMessageQueue(QByteArrayList() << "sink.dummy.instance1")); | 151 | VERIFYEXEC(Sink::ResourceControl::flushMessageQueue(QByteArrayList() << "sink.dummy.instance1")); |
157 | 152 | ||
158 | auto model = Sink::Store::loadModel<Event>(query); | 153 | auto model = Sink::Store::loadModel<Event>(query); |