Commit f636cbda authored by Paweł Wegner's avatar Paweł Wegner
Browse files

MockProvider: future fix.

parent a7af76ec
......@@ -52,8 +52,7 @@ IItem::Pointer MockProvider::rootDirectory() const {
ICloudProvider::ListDirectoryRequest::Pointer MockProvider::listDirectoryAsync(
IItem::Pointer directory, IListDirectoryCallback::Pointer callback) {
return make_unique<MockListDirectoryRequest>(directory,
std::move(callback));
return make_unique<MockListDirectoryRequest>(directory, std::move(callback));
}
ICloudProvider::GetItemRequest::Pointer MockProvider::getItemAsync(
......
......@@ -51,10 +51,10 @@ class MockProvider : public ICloudProvider {
MockListDirectoryRequest(IItem::Pointer directory,
IListDirectoryCallback::Pointer callback);
~MockListDirectoryRequest() { cancel(); }
void finish() { result_.get(); }
void finish() { result_.wait(); }
void cancel() {
cancelled_ = true;
result_.get();
result_.wait();
}
std::vector<IItem::Pointer> result() { return result_.get(); }
......@@ -79,8 +79,8 @@ class MockProvider : public ICloudProvider {
public:
MockDownloadFileRequest(IItem::Pointer item,
IDownloadFileCallback::Pointer);
void finish() { function_.get(); }
void cancel() { function_.get(); }
void finish() { function_.wait(); }
void cancel() { function_.wait(); }
void result() { function_.get(); }
private:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment