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

Unified Diff: mojo/edk/system/multiprocess_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
Index: mojo/edk/system/multiprocess_message_pipe_unittest.cc
diff --git a/mojo/edk/system/multiprocess_message_pipe_unittest.cc b/mojo/edk/system/multiprocess_message_pipe_unittest.cc
index d67c1b7c06dafae8d9120247ca221874b844e411..0c54d34fb6a3604c5088057963ed8bf5a69f300c 100644
--- a/mojo/edk/system/multiprocess_message_pipe_unittest.cc
+++ b/mojo/edk/system/multiprocess_message_pipe_unittest.cc
@@ -10,9 +10,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 "build/build_config.h" // TODO(vtl): Remove this.
@@ -26,6 +23,7 @@
#include "mojo/edk/system/raw_channel.h"
#include "mojo/edk/system/shared_buffer_dispatcher.h"
#include "mojo/edk/system/test_utils.h"
+#include "mojo/edk/test/scoped_test_dir.h"
#include "mojo/edk/test/test_utils.h"
#include "mojo/edk/util/scoped_file.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -448,8 +446,7 @@ class MultiprocessMessagePipeTestWithPipeCount
public testing::WithParamInterface<size_t> {};
TEST_P(MultiprocessMessagePipeTestWithPipeCount, PlatformHandlePassing) {
- base::ScopedTempDir temp_dir;
- ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
+ mojo::test::ScopedTestDir test_dir;
helper()->StartChild("CheckPlatformHandleFile");
@@ -462,9 +459,7 @@ TEST_P(MultiprocessMessagePipeTestWithPipeCount, PlatformHandlePassing) {
size_t pipe_count = GetParam();
for (size_t i = 0; i < pipe_count; ++i) {
- base::FilePath unused;
- util::ScopedFILE fp(
- CreateAndOpenTemporaryFileInDir(temp_dir.path(), &unused));
+ util::ScopedFILE fp(test_dir.CreateFile());
const std::string world("world");
CHECK_EQ(fwrite(&world[0], 1, world.size(), fp.get()), world.size());
fflush(fp.get());
« no previous file with comments | « mojo/edk/embedder/platform_channel_pair_posix_unittest.cc ('k') | mojo/edk/system/platform_handle_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698