summaryrefslogtreecommitdiffstats
path: root/base/files
diff options
context:
space:
mode:
authorrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-09 11:52:37 +0000
committerrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-09 11:52:37 +0000
commit306677bb3c4c686a143da8eeaad66d587be32db6 (patch)
tree998bd94ee2f9e6542aa722257602ecfc498e216a /base/files
parentb9e37058e910316f53cbfb9bb664cd3509276934 (diff)
downloadchromium_src-306677bb3c4c686a143da8eeaad66d587be32db6.zip
chromium_src-306677bb3c4c686a143da8eeaad66d587be32db6.tar.gz
chromium_src-306677bb3c4c686a143da8eeaad66d587be32db6.tar.bz2
Convert most of base and net to use base::File
BUG=322664 R=thakis@chromium.org Review URL: https://codereview.chromium.org/125643002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243852 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/files')
-rw-r--r--base/files/scoped_temp_dir_unittest.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/base/files/scoped_temp_dir_unittest.cc b/base/files/scoped_temp_dir_unittest.cc
index fe243ce..da22230 100644
--- a/base/files/scoped_temp_dir_unittest.cc
+++ b/base/files/scoped_temp_dir_unittest.cc
@@ -5,8 +5,8 @@
#include <string>
#include "base/file_util.h"
+#include "base/files/file.h"
#include "base/files/scoped_temp_dir.h"
-#include "base/platform_file.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
@@ -98,17 +98,13 @@ TEST(ScopedTempDir, MultipleInvocations) {
TEST(ScopedTempDir, LockedTempDir) {
ScopedTempDir dir;
EXPECT_TRUE(dir.CreateUniqueTempDir());
- int file_flags = base::PLATFORM_FILE_CREATE_ALWAYS |
- base::PLATFORM_FILE_WRITE;
- base::PlatformFileError error_code = base::PLATFORM_FILE_OK;
- FilePath file_path(dir.path().Append(FILE_PATH_LITERAL("temp")));
- base::PlatformFile file = base::CreatePlatformFile(file_path, file_flags,
- NULL, &error_code);
- EXPECT_NE(base::kInvalidPlatformFileValue, file);
- EXPECT_EQ(base::PLATFORM_FILE_OK, error_code);
+ base::File file(dir.path().Append(FILE_PATH_LITERAL("temp")),
+ base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
+ EXPECT_TRUE(file.IsValid());
+ EXPECT_EQ(base::File::FILE_OK, file.error_details());
EXPECT_FALSE(dir.Delete()); // We should not be able to delete.
EXPECT_FALSE(dir.path().empty()); // We should still have a valid path.
- EXPECT_TRUE(base::ClosePlatformFile(file));
+ file.Close();
// Now, we should be able to delete.
EXPECT_TRUE(dir.Delete());
}