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

Side by Side Diff: chrome/common/zip_unittest.cc

Issue 10855002: Change the type of file_type parameter to int, as the parameter actually takes or-ed bitmasks, (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix missing comma. Created 8 years, 4 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 unified diff | Download patch
« no previous file with comments | « chrome/common/zip.cc ('k') | chrome/installer/setup/uninstall.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <set> 5 #include <set>
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/scoped_temp_dir.h" 9 #include "base/scoped_temp_dir.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); 46 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir));
47 test_dir = test_dir.AppendASCII("zip"); 47 test_dir = test_dir.AppendASCII("zip");
48 TestUnzipFile(test_dir.Append(filename), expect_hidden_files); 48 TestUnzipFile(test_dir.Append(filename), expect_hidden_files);
49 } 49 }
50 50
51 void TestUnzipFile(const FilePath& path, bool expect_hidden_files) { 51 void TestUnzipFile(const FilePath& path, bool expect_hidden_files) {
52 ASSERT_TRUE(file_util::PathExists(path)) << "no file " << path.value(); 52 ASSERT_TRUE(file_util::PathExists(path)) << "no file " << path.value();
53 ASSERT_TRUE(zip::Unzip(path, test_dir_)); 53 ASSERT_TRUE(zip::Unzip(path, test_dir_));
54 54
55 file_util::FileEnumerator files(test_dir_, true, 55 file_util::FileEnumerator files(test_dir_, true,
56 static_cast<file_util::FileEnumerator::FileType>( 56 file_util::FileEnumerator::FILES |
57 file_util::FileEnumerator::FILES | 57 file_util::FileEnumerator::DIRECTORIES);
58 file_util::FileEnumerator::DIRECTORIES));
59 FilePath next_path = files.Next(); 58 FilePath next_path = files.Next();
60 size_t count = 0; 59 size_t count = 0;
61 while (!next_path.value().empty()) { 60 while (!next_path.value().empty()) {
62 if (next_path.value().find(FILE_PATH_LITERAL(".svn")) == 61 if (next_path.value().find(FILE_PATH_LITERAL(".svn")) ==
63 FilePath::StringType::npos) { 62 FilePath::StringType::npos) {
64 EXPECT_EQ(zip_contents_.count(next_path), 1U) << 63 EXPECT_EQ(zip_contents_.count(next_path), 1U) <<
65 "Couldn't find " << next_path.value(); 64 "Couldn't find " << next_path.value();
66 count++; 65 count++;
67 } 66 }
68 next_path = files.Next(); 67 next_path = files.Next();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 144
146 ScopedTempDir temp_dir; 145 ScopedTempDir temp_dir;
147 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); 146 ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
148 FilePath zip_file = temp_dir.path().AppendASCII("out.zip"); 147 FilePath zip_file = temp_dir.path().AppendASCII("out.zip");
149 148
150 EXPECT_TRUE(zip::Zip(src_dir, zip_file, false)); 149 EXPECT_TRUE(zip::Zip(src_dir, zip_file, false));
151 TestUnzipFile(zip_file, false); 150 TestUnzipFile(zip_file, false);
152 } 151 }
153 152
154 } // namespace 153 } // namespace
OLDNEW
« no previous file with comments | « chrome/common/zip.cc ('k') | chrome/installer/setup/uninstall.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698