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

Unified Diff: mojo/edk/test/scoped_test_dir.h

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/BUILD.gn ('k') | mojo/edk/test/scoped_test_dir.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/test/scoped_test_dir.h
diff --git a/mojo/edk/test/scoped_test_dir.h b/mojo/edk/test/scoped_test_dir.h
new file mode 100644
index 0000000000000000000000000000000000000000..4db372ff3e43934b9fdba5723ce0c0cd0e3e5c47
--- /dev/null
+++ b/mojo/edk/test/scoped_test_dir.h
@@ -0,0 +1,33 @@
+// 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.
+
+#ifndef MOJO_EDK_TEST_SCOPED_TEST_DIR_H_
+#define MOJO_EDK_TEST_SCOPED_TEST_DIR_H_
+
+#include "base/files/scoped_temp_dir.h"
+#include "mojo/edk/util/scoped_file.h"
+#include "mojo/public/cpp/system/macros.h"
+
+namespace mojo {
+namespace test {
+
+// Creates/destroyes a temporary directory for test purposes. (Unlike
+// |base::ScopedTempDir|, this automatically creates the temporary directory.)
+class ScopedTestDir {
+ public:
+ ScopedTestDir();
+ ~ScopedTestDir();
+
+ util::ScopedFILE CreateFile();
+
+ private:
+ base::ScopedTempDir temp_dir_;
+
+ MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedTestDir);
+};
+
+} // namespace test
+} // namespace mojo
+
+#endif // MOJO_EDK_TEST_SCOPED_TEST_DIR_H_
« no previous file with comments | « mojo/edk/test/BUILD.gn ('k') | mojo/edk/test/scoped_test_dir.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698