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

Unified Diff: mojo/edk/test/mojo_test_base.h

Issue 2043713004: Mojo: Add NotifyBadMessage API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no bindings Created 4 years, 6 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
« no previous file with comments | « mojo/edk/system/ports_message.h ('k') | mojo/edk/test/mojo_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/test/mojo_test_base.h
diff --git a/mojo/edk/test/mojo_test_base.h b/mojo/edk/test/mojo_test_base.h
index 3d5e56e3d1581fcd800a75320a9a212eded4ba99..4f5514533a58de3112da5ab902686edb6a3bb90b 100644
--- a/mojo/edk/test/mojo_test_base.h
+++ b/mojo/edk/test/mojo_test_base.h
@@ -34,7 +34,9 @@ class MojoTestBase : public testing::Test {
class ClientController {
public:
- ClientController(const std::string& client_name, MojoTestBase* test);
+ ClientController(const std::string& client_name,
+ MojoTestBase* test,
+ const ProcessErrorCallback& process_error_callback_);
~ClientController();
MojoHandle pipe() const { return pipe_.get().value(); }
@@ -53,6 +55,13 @@ class MojoTestBase : public testing::Test {
DISALLOW_COPY_AND_ASSIGN(ClientController);
};
+ // Set the callback to handle bad messages received from test client
+ // processes. This can be set to a different callback before starting each
+ // client.
+ void set_process_error_callback(const ProcessErrorCallback& callback) {
+ process_error_callback_ = callback;
+ }
+
ClientController& StartClient(const std::string& client_name);
template <typename HandlerFunc>
@@ -144,6 +153,8 @@ class MojoTestBase : public testing::Test {
std::vector<std::unique_ptr<ClientController>> clients_;
+ ProcessErrorCallback process_error_callback_;
+
DISALLOW_COPY_AND_ASSIGN(MojoTestBase);
};
« no previous file with comments | « mojo/edk/system/ports_message.h ('k') | mojo/edk/test/mojo_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698