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

Unified Diff: mojo/edk/system/raw_channel_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/raw_channel_unittest.cc
diff --git a/mojo/edk/system/raw_channel_unittest.cc b/mojo/edk/system/raw_channel_unittest.cc
index db11b5b395a5ecff0321cb02d77b53aa6a15b1d0..82e8eb5ab3844474e5346052be7046fa26da75f6 100644
--- a/mojo/edk/system/raw_channel_unittest.cc
+++ b/mojo/edk/system/raw_channel_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 "base/memory/scoped_ptr.h"
@@ -27,6 +24,7 @@
#include "mojo/edk/system/mutex.h"
#include "mojo/edk/system/test_utils.h"
#include "mojo/edk/system/transport_data.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"
@@ -801,8 +799,7 @@ class ReadPlatformHandlesCheckerRawChannelDelegate
#define MAYBE_ReadWritePlatformHandles DISABLED_ReadWritePlatformHandles
#endif
TEST_F(RawChannelTest, MAYBE_ReadWritePlatformHandles) {
- base::ScopedTempDir temp_dir;
- ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
+ mojo::test::ScopedTestDir test_dir;
WriteOnlyRawChannelDelegate write_delegate;
scoped_ptr<RawChannel> rc_write(RawChannel::Create(handles[0].Pass()));
@@ -816,12 +813,9 @@ TEST_F(RawChannelTest, MAYBE_ReadWritePlatformHandles) {
base::Bind(&InitOnIOThread, rc_read.get(),
base::Unretained(&read_delegate)));
- base::FilePath unused;
- util::ScopedFILE fp1(
- base::CreateAndOpenTemporaryFileInDir(temp_dir.path(), &unused));
+ util::ScopedFILE fp1(test_dir.CreateFile());
EXPECT_EQ(1u, fwrite("1", 1, 1, fp1.get()));
- util::ScopedFILE fp2(
- base::CreateAndOpenTemporaryFileInDir(temp_dir.path(), &unused));
+ util::ScopedFILE fp2(test_dir.CreateFile());
EXPECT_EQ(1u, fwrite("2", 1, 1, fp2.get()));
{
« no previous file with comments | « mojo/edk/system/platform_handle_dispatcher_unittest.cc ('k') | mojo/edk/system/remote_message_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698