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

Unified Diff: mojo/system/embedder/embedder_unittest.cc

Issue 187383007: Mojo: Replace TestWithIOThreadBase with just a helper TestIOThread class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « no previous file | mojo/system/raw_channel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/embedder/embedder_unittest.cc
diff --git a/mojo/system/embedder/embedder_unittest.cc b/mojo/system/embedder/embedder_unittest.cc
index 13e7c8f93fe0a0c66e7b8457b4a7766d54e95cb2..0f2634af02bfb77d9f4cdb9a65399c4e896c5c0a 100644
--- a/mojo/system/embedder/embedder_unittest.cc
+++ b/mojo/system/embedder/embedder_unittest.cc
@@ -14,12 +14,25 @@
#include "mojo/system/embedder/platform_channel_pair.h"
#include "mojo/system/embedder/test_embedder.h"
#include "mojo/system/test_utils.h"
+#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
namespace embedder {
namespace {
-typedef system::test::TestWithIOThreadBase EmbedderTest;
+class EmbedderTest : public testing::Test {
+ public:
+ EmbedderTest() {}
+ virtual ~EmbedderTest() {}
+
+ protected:
+ system::test::TestIOThread* io_thread() { return &io_thread_; }
+
+ private:
+ system::test::TestIOThread io_thread_;
+
+ DISALLOW_COPY_AND_ASSIGN(EmbedderTest);
+};
void StoreChannelInfo(ChannelInfo** store_channel_info_here,
ChannelInfo* channel_info) {
@@ -37,14 +50,14 @@ TEST_F(EmbedderTest, ChannelsBasic) {
ChannelInfo* server_channel_info = NULL;
MojoHandle server_mp = CreateChannel(server_handle.Pass(),
- io_thread_task_runner(),
+ io_thread()->task_runner(),
base::Bind(&StoreChannelInfo,
&server_channel_info));
EXPECT_NE(server_mp, MOJO_HANDLE_INVALID);
ChannelInfo* client_channel_info = NULL;
MojoHandle client_mp = CreateChannel(client_handle.Pass(),
- io_thread_task_runner(),
+ io_thread()->task_runner(),
base::Bind(&StoreChannelInfo,
&client_channel_info));
EXPECT_NE(client_mp, MOJO_HANDLE_INVALID);
@@ -73,13 +86,13 @@ TEST_F(EmbedderTest, ChannelsBasic) {
EXPECT_EQ(MOJO_RESULT_OK, MojoClose(client_mp));
EXPECT_TRUE(server_channel_info != NULL);
- system::test::PostTaskAndWait(io_thread_task_runner(),
+ system::test::PostTaskAndWait(io_thread()->task_runner(),
FROM_HERE,
base::Bind(&DestroyChannelOnIOThread,
server_channel_info));
EXPECT_TRUE(client_channel_info != NULL);
- system::test::PostTaskAndWait(io_thread_task_runner(),
+ system::test::PostTaskAndWait(io_thread()->task_runner(),
FROM_HERE,
base::Bind(&DestroyChannelOnIOThread,
client_channel_info));
@@ -96,14 +109,14 @@ TEST_F(EmbedderTest, ChannelsHandlePassing) {
ChannelInfo* server_channel_info = NULL;
MojoHandle server_mp = CreateChannel(server_handle.Pass(),
- io_thread_task_runner(),
+ io_thread()->task_runner(),
base::Bind(&StoreChannelInfo,
&server_channel_info));
EXPECT_NE(server_mp, MOJO_HANDLE_INVALID);
ChannelInfo* client_channel_info = NULL;
MojoHandle client_mp = CreateChannel(client_handle.Pass(),
- io_thread_task_runner(),
+ io_thread()->task_runner(),
base::Bind(&StoreChannelInfo,
&client_channel_info));
EXPECT_NE(client_mp, MOJO_HANDLE_INVALID);
« no previous file with comments | « no previous file | mojo/system/raw_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698