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

Unified Diff: webkit/browser/fileapi/test_file_set.cc

Issue 167403002: Remove some PlatformFile uses from WebKit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « webkit/browser/fileapi/sandbox_prioritized_origin_database.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/browser/fileapi/test_file_set.cc
diff --git a/webkit/browser/fileapi/test_file_set.cc b/webkit/browser/fileapi/test_file_set.cc
index 109a0558491214654d1296fb5d17410caefedb2c..a762e338e6ef4c850ab8acd9865b23e10bf94d64 100644
--- a/webkit/browser/fileapi/test_file_set.cc
+++ b/webkit/browser/fileapi/test_file_set.cc
@@ -7,8 +7,8 @@
#include <string>
#include "base/file_util.h"
+#include "base/files/file.h"
#include "base/logging.h"
-#include "base/platform_file.h"
#include "base/rand_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -46,20 +46,14 @@ void SetUpOneTestCase(const base::FilePath& root_path,
ASSERT_TRUE(base::CreateDirectory(path));
return;
}
- base::PlatformFileError error_code;
- bool created = false;
- int file_flags = base::PLATFORM_FILE_CREATE_ALWAYS |
- base::PLATFORM_FILE_WRITE;
- base::PlatformFile file_handle =
- base::CreatePlatformFile(path, file_flags, &created, &error_code);
- EXPECT_TRUE(created);
- ASSERT_EQ(base::PLATFORM_FILE_OK, error_code);
- ASSERT_NE(base::kInvalidPlatformFileValue, file_handle);
- EXPECT_TRUE(base::ClosePlatformFile(file_handle));
- if (test_case.data_file_size > 0U) {
+ base::File file(path,
+ base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
+ ASSERT_TRUE(file.IsValid());
+ if (test_case.data_file_size) {
std::string content = base::RandBytesAsString(test_case.data_file_size);
+ EXPECT_LE(test_case.data_file_size, kint32max);
ASSERT_EQ(static_cast<int>(content.size()),
- file_util::WriteFile(path, content.data(), content.size()));
+ file.Write(0, content.data(), static_cast<int>(content.size())));
}
}
« no previous file with comments | « webkit/browser/fileapi/sandbox_prioritized_origin_database.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698