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

Side by Side Diff: base/memory/scoped_temp_dir_unittest.cc

Issue 6714032: Move some files in base to base/memory. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: only base Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/platform_file.h" 6 #include "base/platform_file.h"
7 #include "base/scoped_temp_dir.h" 7 #include "base/memory/scoped_temp_dir.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 TEST(ScopedTempDir, FullPath) { 10 TEST(ScopedTempDir, FullPath) {
11 FilePath test_path; 11 FilePath test_path;
12 file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("scoped_temp_dir"), 12 file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("scoped_temp_dir"),
13 &test_path); 13 &test_path);
14 14
15 // Against an existing dir, it should get destroyed when leaving scope. 15 // Against an existing dir, it should get destroyed when leaving scope.
16 EXPECT_TRUE(file_util::DirectoryExists(test_path)); 16 EXPECT_TRUE(file_util::DirectoryExists(test_path));
17 { 17 {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 NULL, &error_code); 101 NULL, &error_code);
102 EXPECT_NE(base::kInvalidPlatformFileValue, file); 102 EXPECT_NE(base::kInvalidPlatformFileValue, file);
103 EXPECT_EQ(base::PLATFORM_FILE_OK, error_code); 103 EXPECT_EQ(base::PLATFORM_FILE_OK, error_code);
104 EXPECT_FALSE(dir.Delete()); // We should not be able to delete. 104 EXPECT_FALSE(dir.Delete()); // We should not be able to delete.
105 EXPECT_FALSE(dir.path().empty()); // We should still have a valid path. 105 EXPECT_FALSE(dir.path().empty()); // We should still have a valid path.
106 EXPECT_TRUE(base::ClosePlatformFile(file)); 106 EXPECT_TRUE(base::ClosePlatformFile(file));
107 // Now, we should be able to delete. 107 // Now, we should be able to delete.
108 EXPECT_TRUE(dir.Delete()); 108 EXPECT_TRUE(dir.Delete());
109 } 109 }
110 #endif // defined(OS_WIN) 110 #endif // defined(OS_WIN)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698