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 <stddef.h> |
| 6 #include <stdint.h> |
| 7 |
5 #include <set> | 8 #include <set> |
6 #include <string> | 9 #include <string> |
7 #include <vector> | 10 #include <vector> |
8 | 11 |
9 #include "base/files/file.h" | 12 #include "base/files/file.h" |
10 #include "base/files/file_enumerator.h" | 13 #include "base/files/file_enumerator.h" |
11 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
12 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
13 #include "base/files/scoped_temp_dir.h" | 16 #include "base/files/scoped_temp_dir.h" |
14 #include "base/path_service.h" | 17 #include "base/path_service.h" |
15 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
16 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
| 20 #include "build/build_config.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
18 #include "testing/platform_test.h" | 22 #include "testing/platform_test.h" |
19 #include "third_party/zlib/google/zip.h" | 23 #include "third_party/zlib/google/zip.h" |
20 #include "third_party/zlib/google/zip_reader.h" | 24 #include "third_party/zlib/google/zip_reader.h" |
21 | 25 |
22 namespace { | 26 namespace { |
23 | 27 |
24 // Make the test a PlatformTest to setup autorelease pools properly on Mac. | 28 // Make the test a PlatformTest to setup autorelease pools properly on Mac. |
25 class ZipTest : public PlatformTest { | 29 class ZipTest : public PlatformTest { |
26 protected: | 30 protected: |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 ASSERT_TRUE(scoped_temp_dir.CreateUniqueTempDir()); | 322 ASSERT_TRUE(scoped_temp_dir.CreateUniqueTempDir()); |
319 const base::FilePath& temp_dir = scoped_temp_dir.path(); | 323 const base::FilePath& temp_dir = scoped_temp_dir.path(); |
320 | 324 |
321 ASSERT_TRUE(zip::Unzip(test_zip_file, temp_dir)); | 325 ASSERT_TRUE(zip::Unzip(test_zip_file, temp_dir)); |
322 EXPECT_TRUE(base::DirectoryExists(temp_dir.AppendASCII("d"))); | 326 EXPECT_TRUE(base::DirectoryExists(temp_dir.AppendASCII("d"))); |
323 | 327 |
324 for (int i = 0; i < 8; i++) { | 328 for (int i = 0; i < 8; i++) { |
325 SCOPED_TRACE(base::StringPrintf("Processing %d.txt", i)); | 329 SCOPED_TRACE(base::StringPrintf("Processing %d.txt", i)); |
326 base::FilePath file_path = temp_dir.AppendASCII( | 330 base::FilePath file_path = temp_dir.AppendASCII( |
327 base::StringPrintf("%d.txt", i)); | 331 base::StringPrintf("%d.txt", i)); |
328 int64 file_size = -1; | 332 int64_t file_size = -1; |
329 EXPECT_TRUE(base::GetFileSize(file_path, &file_size)); | 333 EXPECT_TRUE(base::GetFileSize(file_path, &file_size)); |
330 EXPECT_EQ(static_cast<int64>(i), file_size); | 334 EXPECT_EQ(static_cast<int64_t>(i), file_size); |
331 } | 335 } |
332 } | 336 } |
333 | 337 |
334 } // namespace | 338 } // namespace |
OLD | NEW |