OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <set> | 5 #include <set> |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 EXPECT_EQ(zip_contents_.count(next_path), 1U) << | 64 EXPECT_EQ(zip_contents_.count(next_path), 1U) << |
65 "Couldn't find " << next_path.value(); | 65 "Couldn't find " << next_path.value(); |
66 count++; | 66 count++; |
67 } | 67 } |
68 next_path = files.Next(); | 68 next_path = files.Next(); |
69 } | 69 } |
70 | 70 |
71 size_t expected_count = 0; | 71 size_t expected_count = 0; |
72 for (std::set<FilePath>::iterator iter = zip_contents_.begin(); | 72 for (std::set<FilePath>::iterator iter = zip_contents_.begin(); |
73 iter != zip_contents_.end(); ++iter) { | 73 iter != zip_contents_.end(); ++iter) { |
74 if (expect_hidden_files || iter->BaseName().ToWStringHack()[0] != L'.') | 74 if (expect_hidden_files || iter->BaseName().value()[0] != L'.') |
75 ++expected_count; | 75 ++expected_count; |
76 } | 76 } |
77 | 77 |
78 EXPECT_EQ(expected_count, count); | 78 EXPECT_EQ(expected_count, count); |
79 } | 79 } |
80 | 80 |
81 // the path to temporary directory used to contain the test operations | 81 // the path to temporary directory used to contain the test operations |
82 FilePath test_dir_; | 82 FilePath test_dir_; |
83 | 83 |
84 ScopedTempDir temp_dir_; | 84 ScopedTempDir temp_dir_; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 ScopedTempDir temp_dir; | 137 ScopedTempDir temp_dir; |
138 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 138 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
139 FilePath zip_file = temp_dir.path().AppendASCII("out.zip"); | 139 FilePath zip_file = temp_dir.path().AppendASCII("out.zip"); |
140 | 140 |
141 EXPECT_TRUE(Zip(src_dir, zip_file, false)); | 141 EXPECT_TRUE(Zip(src_dir, zip_file, false)); |
142 TestUnzipFile(zip_file, false); | 142 TestUnzipFile(zip_file, false); |
143 } | 143 } |
144 | 144 |
145 } // namespace | 145 } // namespace |
OLD | NEW |