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

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: 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
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..94affc281b97691d5d3e7dc8d402d532a31a3aeb 100644
--- a/mojo/edk/test/mojo_test_base.h
+++ b/mojo/edk/test/mojo_test_base.h
@@ -34,13 +34,17 @@ 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 base::Closure& bad_message_callback);
~ClientController();
MojoHandle pipe() const { return pipe_.get().value(); }
int WaitForShutdown();
+ MultiprocessTestHelper& helper() { return helper_; }
+
private:
friend class MojoTestBase;
@@ -53,6 +57,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_bad_message_callback(const base::Closure& callback) {
+ bad_message_callback_ = callback;
+ }
+
ClientController& StartClient(const std::string& client_name);
template <typename HandlerFunc>
@@ -144,6 +155,8 @@ class MojoTestBase : public testing::Test {
std::vector<std::unique_ptr<ClientController>> clients_;
+ base::Closure bad_message_callback_;
+
DISALLOW_COPY_AND_ASSIGN(MojoTestBase);
};

Powered by Google App Engine
This is Rietveld 408576698