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

Unified Diff: mojo/system/remote_message_pipe_posix_unittest.cc

Issue 140403002: Mojo: Add the ability to hook up a channel to the embedder API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win Created 6 years, 11 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/system/raw_channel_posix_unittest.cc ('k') | mojo/system/test_embedder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/remote_message_pipe_posix_unittest.cc
diff --git a/mojo/system/remote_message_pipe_posix_unittest.cc b/mojo/system/remote_message_pipe_posix_unittest.cc
index 537392fd4dac43cf623e833aa3969fcf2dd7a58d..c1d6b0c862792f89bff9bad53cd17c735bdd9b0b 100644
--- a/mojo/system/remote_message_pipe_posix_unittest.cc
+++ b/mojo/system/remote_message_pipe_posix_unittest.cc
@@ -10,7 +10,6 @@
#include "base/basictypes.h"
#include "base/bind.h"
-#include "base/callback.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
@@ -23,24 +22,18 @@
#include "mojo/system/scoped_platform_handle.h"
#include "mojo/system/test_utils.h"
#include "mojo/system/waiter.h"
-#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
namespace system {
namespace {
-class RemoteMessagePipeTest : public testing::Test {
+class RemoteMessagePipeTest : public test::TestWithIOThreadBase {
public:
- RemoteMessagePipeTest() : io_thread_("io_thread") {
- }
-
- virtual ~RemoteMessagePipeTest() {
- }
+ RemoteMessagePipeTest() {}
+ virtual ~RemoteMessagePipeTest() {}
virtual void SetUp() OVERRIDE {
- io_thread_.StartWithOptions(
- base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
-
+ test::TestWithIOThreadBase::SetUp();
test::PostTaskAndWait(io_thread_task_runner(),
FROM_HERE,
base::Bind(&RemoteMessagePipeTest::SetUpOnIOThread,
@@ -52,7 +45,7 @@ class RemoteMessagePipeTest : public testing::Test {
FROM_HERE,
base::Bind(&RemoteMessagePipeTest::TearDownOnIOThread,
base::Unretained(this)));
- io_thread_.Stop();
+ test::TestWithIOThreadBase::TearDown();
}
// This connects MP 0, port 1 and MP 1, port 0 (leaving MP 0, port 0 and MP 1,
@@ -79,15 +72,6 @@ class RemoteMessagePipeTest : public testing::Test {
base::Unretained(this), channel_index, mp));
}
- protected:
- base::MessageLoop* io_thread_message_loop() {
- return io_thread_.message_loop();
- }
-
- scoped_refptr<base::TaskRunner> io_thread_task_runner() {
- return io_thread_message_loop()->message_loop_proxy();
- }
-
private:
void SetUpOnIOThread() {
CHECK_EQ(base::MessageLoop::current(), io_thread_message_loop());
@@ -151,7 +135,6 @@ class RemoteMessagePipeTest : public testing::Test {
}
}
- base::Thread io_thread_;
ScopedPlatformHandle platform_handles_[2];
scoped_refptr<Channel> channels_[2];
« no previous file with comments | « mojo/system/raw_channel_posix_unittest.cc ('k') | mojo/system/test_embedder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698