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

Unified Diff: mojo/edk/test/scoped_test_dir.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/test/scoped_test_dir.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/test/scoped_test_dir.cc
diff --git a/mojo/edk/test/scoped_test_dir.cc b/mojo/edk/test/scoped_test_dir.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5bd768b352a14432f7d9b49882e10b210dff64bf
--- /dev/null
+++ b/mojo/edk/test/scoped_test_dir.cc
@@ -0,0 +1,27 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/edk/test/scoped_test_dir.h"
+
+#include "base/files/file_path.h"
+#include "base/files/file_util.h"
+#include "base/logging.h"
+
+namespace mojo {
+namespace test {
+
+ScopedTestDir::ScopedTestDir() {
+ CHECK(temp_dir_.CreateUniqueTempDir());
+}
+
+ScopedTestDir::~ScopedTestDir() {}
+
+util::ScopedFILE ScopedTestDir::CreateFile() {
+ base::FilePath unused;
+ return util::ScopedFILE(
+ base::CreateAndOpenTemporaryFileInDir(temp_dir_.path(), &unused));
+}
+
+} // namespace test
+} // namespace mojo
« no previous file with comments | « mojo/edk/test/scoped_test_dir.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698