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

Unified Diff: mojo/system/test_utils.h

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 | « mojo/system/remote_message_pipe_posix_unittest.cc ('k') | mojo/system/test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/test_utils.h
diff --git a/mojo/system/test_utils.h b/mojo/system/test_utils.h
index 9310bd95b90d78a9d1956f28ca9054b98c04d56a..23b704b3599881b2384fcc7a4b98c1dba16cc05e 100644
--- a/mojo/system/test_utils.h
+++ b/mojo/system/test_utils.h
@@ -14,7 +14,6 @@
#include "base/task_runner.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
-#include "testing/gtest/include/gtest/gtest.h"
namespace tracked_objects {
class Location;
@@ -50,29 +49,26 @@ void PostTaskAndWait(scoped_refptr<base::TaskRunner> task_runner,
const tracked_objects::Location& from_here,
const base::Closure& task);
-// TestWithIOThreadBase --------------------------------------------------------
+// TestIOThread ----------------------------------------------------------------
-class TestWithIOThreadBase : public testing::Test {
+class TestIOThread {
public:
- TestWithIOThreadBase();
- virtual ~TestWithIOThreadBase();
+ // Note: The I/O thread is started on construction and stopped on destruction.
+ TestIOThread();
+ ~TestIOThread();
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
-
- protected:
- base::MessageLoopForIO* io_thread_message_loop() {
+ base::MessageLoopForIO* message_loop() {
return static_cast<base::MessageLoopForIO*>(io_thread_.message_loop());
}
- scoped_refptr<base::TaskRunner> io_thread_task_runner() {
- return io_thread_message_loop()->message_loop_proxy();
+ scoped_refptr<base::TaskRunner> task_runner() {
+ return message_loop()->message_loop_proxy();
}
private:
base::Thread io_thread_;
- DISALLOW_COPY_AND_ASSIGN(TestWithIOThreadBase);
+ DISALLOW_COPY_AND_ASSIGN(TestIOThread);
};
} // namespace test
« no previous file with comments | « mojo/system/remote_message_pipe_posix_unittest.cc ('k') | mojo/system/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698