| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "third_party/zlib/google/zip_reader.h" | 5 #include "third_party/zlib/google/zip_reader.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/md5.h" | 13 #include "base/md5.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/platform_file.h" | 15 #include "base/platform_file.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "base/time.h" | 17 #include "base/time/time.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 #include "testing/platform_test.h" | 19 #include "testing/platform_test.h" |
| 20 #include "third_party/zlib/google/zip_internal.h" | 20 #include "third_party/zlib/google/zip_internal.h" |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // Wrap PlatformFiles in a class so that we don't leak them in tests. | 24 // Wrap PlatformFiles in a class so that we don't leak them in tests. |
| 25 class PlatformFileWrapper { | 25 class PlatformFileWrapper { |
| 26 public: | 26 public: |
| 27 typedef enum { | 27 typedef enum { |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 ASSERT_TRUE(reader.ExtractCurrentEntryToFilePath( | 422 ASSERT_TRUE(reader.ExtractCurrentEntryToFilePath( |
| 423 test_dir_.AppendASCII("test.txt"))); | 423 test_dir_.AppendASCII("test.txt"))); |
| 424 | 424 |
| 425 std::string actual; | 425 std::string actual; |
| 426 ASSERT_TRUE(file_util::ReadFileToString( | 426 ASSERT_TRUE(file_util::ReadFileToString( |
| 427 test_dir_.AppendASCII("test.txt"), &actual)); | 427 test_dir_.AppendASCII("test.txt"), &actual)); |
| 428 EXPECT_EQ(std::string("This is a test.\n"), actual); | 428 EXPECT_EQ(std::string("This is a test.\n"), actual); |
| 429 } | 429 } |
| 430 | 430 |
| 431 } // namespace zip | 431 } // namespace zip |
| OLD | NEW |