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

Unified Diff: mojo/edk/system/remote_message_pipe_unittest.cc

Issue 1354433003: Add a mojo::test::ScopedTestDir and convert tests to use it. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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/raw_channel_unittest.cc ('k') | mojo/edk/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/remote_message_pipe_unittest.cc
diff --git a/mojo/edk/system/remote_message_pipe_unittest.cc b/mojo/edk/system/remote_message_pipe_unittest.cc
index 25b91c078a859e264c772b5d5dac3c8fba7931b8..18c721c1296bd7fb4b4c2213722bf1816a59f219 100644
--- a/mojo/edk/system/remote_message_pipe_unittest.cc
+++ b/mojo/edk/system/remote_message_pipe_unittest.cc
@@ -9,9 +9,6 @@
#include <vector>
#include "base/bind.h"
-#include "base/files/file_path.h"
-#include "base/files/file_util.h"
-#include "base/files/scoped_temp_dir.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
@@ -31,6 +28,7 @@
#include "mojo/edk/system/shared_buffer_dispatcher.h"
#include "mojo/edk/system/test_utils.h"
#include "mojo/edk/system/waiter.h"
+#include "mojo/edk/test/scoped_test_dir.h"
#include "mojo/edk/test/test_io_thread.h"
#include "mojo/edk/test/test_utils.h"
#include "mojo/edk/util/scoped_file.h"
@@ -1024,8 +1022,7 @@ TEST_F(RemoteMessagePipeTest, MAYBE_SharedBufferPassing) {
#define MAYBE_PlatformHandlePassing DISABLED_PlatformHandlePassing
#endif
TEST_F(RemoteMessagePipeTest, MAYBE_PlatformHandlePassing) {
- base::ScopedTempDir temp_dir;
- ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
+ mojo::test::ScopedTestDir test_dir;
static const char kHello[] = "hello";
static const char kWorld[] = "world";
@@ -1039,9 +1036,7 @@ TEST_F(RemoteMessagePipeTest, MAYBE_PlatformHandlePassing) {
scoped_refptr<MessagePipe> mp1(MessagePipe::CreateProxyLocal(&ep1));
BootstrapChannelEndpoints(ep0, ep1);
- base::FilePath unused;
- util::ScopedFILE fp(
- base::CreateAndOpenTemporaryFileInDir(temp_dir.path(), &unused));
+ util::ScopedFILE fp(test_dir.CreateFile());
EXPECT_EQ(sizeof(kHello), fwrite(kHello, 1, sizeof(kHello), fp.get()));
// We'll try to pass this dispatcher, which will cause a |PlatformHandle| to
// be passed.
« no previous file with comments | « mojo/edk/system/raw_channel_unittest.cc ('k') | mojo/edk/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698