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

Unified Diff: third_party/zlib/google/zip_unittest.cc

Issue 166573007: Remove some PlatformFile uses from zlib (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Yet another rebase 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 | « third_party/zlib/google/zip_reader_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/zlib/google/zip_unittest.cc
diff --git a/third_party/zlib/google/zip_unittest.cc b/third_party/zlib/google/zip_unittest.cc
index afa92f137c14283b1fc912a1cb7237a0eeb47fa1..ea456f1aa33f36d0bf8b66a01efd891ac6b660f6 100644
--- a/third_party/zlib/google/zip_unittest.cc
+++ b/third_party/zlib/google/zip_unittest.cc
@@ -7,6 +7,7 @@
#include <vector>
#include "base/file_util.h"
+#include "base/files/file.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
@@ -280,17 +281,17 @@ TEST_F(ZipTest, ZipFiles) {
base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- base::FilePath zip_file = temp_dir.path().AppendASCII("out.zip");
+ base::FilePath zip_name = temp_dir.path().AppendASCII("out.zip");
- const int flags = base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_WRITE;
- const base::PlatformFile zip_fd =
- base::CreatePlatformFile(zip_file, flags, NULL, NULL);
- ASSERT_LE(0, zip_fd);
- EXPECT_TRUE(zip::ZipFiles(src_dir, zip_file_list_, zip_fd));
- base::ClosePlatformFile(zip_fd);
+ base::File zip_file(zip_name,
+ base::File::FLAG_CREATE | base::File::FLAG_WRITE);
+ ASSERT_TRUE(zip_file.IsValid());
+ EXPECT_TRUE(zip::ZipFiles(src_dir, zip_file_list_,
+ zip_file.GetPlatformFile()));
+ zip_file.Close();
zip::ZipReader reader;
- EXPECT_TRUE(reader.Open(zip_file));
+ EXPECT_TRUE(reader.Open(zip_name));
EXPECT_EQ(zip_file_list_.size(), static_cast<size_t>(reader.num_entries()));
for (size_t i = 0; i < zip_file_list_.size(); ++i) {
EXPECT_TRUE(reader.LocateAndOpenEntry(zip_file_list_[i]));
@@ -302,4 +303,3 @@ TEST_F(ZipTest, ZipFiles) {
#endif // defined(OS_POSIX)
} // namespace
-
« no previous file with comments | « third_party/zlib/google/zip_reader_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698