Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1075)

Unified Diff: mojo/public/cpp/bindings/tests/router_test_util.h

Issue 1552983003: Fix a bunch of mojo_public_*_unittests with the new EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/tests/router_test_util.h
diff --git a/mojo/public/cpp/bindings/tests/router_test_util.h b/mojo/public/cpp/bindings/tests/router_test_util.h
index 05707d68f953be3fbb7c7244ac23137696688729..c6fb372d3f426283dd19e58496bd2cee0a105b2b 100644
--- a/mojo/public/cpp/bindings/tests/router_test_util.h
+++ b/mojo/public/cpp/bindings/tests/router_test_util.h
@@ -9,6 +9,7 @@
#include <string>
+#include "base/callback.h"
#include "mojo/public/cpp/bindings/message.h"
namespace mojo {
@@ -24,12 +25,15 @@ void AllocResponseMessage(uint32_t name,
class MessageAccumulator : public MessageReceiver {
public:
- explicit MessageAccumulator(MessageQueue* queue);
+ MessageAccumulator(MessageQueue* queue,
+ const base::Closure& closure = base::Closure());
+ ~MessageAccumulator() override;
bool Accept(Message* message) override;
private:
MessageQueue* queue_;
+ base::Closure closure_;
};
class ResponseGenerator : public MessageReceiverWithResponderStatus {
@@ -49,7 +53,8 @@ class ResponseGenerator : public MessageReceiverWithResponderStatus {
class LazyResponseGenerator : public ResponseGenerator {
public:
- LazyResponseGenerator();
+ explicit LazyResponseGenerator(
+ const base::Closure& closure = base::Closure());
~LazyResponseGenerator() override;
@@ -60,6 +65,8 @@ class LazyResponseGenerator : public ResponseGenerator {
bool responder_is_valid() const { return responder_->IsValid(); }
+ void set_closure(const base::Closure& closure) { closure_ = closure; }
+
// Sends the response and delete the responder.
void CompleteWithResponse() { Complete(true); }
@@ -75,6 +82,7 @@ class LazyResponseGenerator : public ResponseGenerator {
uint32_t name_;
uint64_t request_id_;
std::string request_string_;
+ base::Closure closure_;
};
} // namespace test
« no previous file with comments | « mojo/public/cpp/bindings/tests/request_response_unittest.cc ('k') | mojo/public/cpp/bindings/tests/router_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698