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

Unified Diff: chrome/common/zip_unittest.cc

Issue 8508003: zip: Add ZipReader and rework Unzip() using the new class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a win failure Created 9 years, 1 month 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 | « chrome/common/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: chrome/common/zip_unittest.cc
diff --git a/chrome/common/zip_unittest.cc b/chrome/common/zip_unittest.cc
index 11087200b2f7f3cc45267468a0d548b075149eeb..6c857e17480699e6ac248cafb5420efd053c161d 100644
--- a/chrome/common/zip_unittest.cc
+++ b/chrome/common/zip_unittest.cc
@@ -113,10 +113,13 @@ TEST_F(ZipTest, UnzipEvil) {
TEST_F(ZipTest, UnzipEvil2) {
FilePath path;
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &path));
+ // The zip file contains an evil file with invalid UTF-8 in its file
+ // name.
path = path.AppendASCII("zip").AppendASCII("evil_via_invalid_utf8.zip");
// See the comment at UnzipEvil() for why we do this.
FilePath output_dir = test_dir_.AppendASCII("out");
- ASSERT_TRUE(zip::Unzip(path, output_dir));
+ // This should fail as it contains an evil file.
+ ASSERT_FALSE(zip::Unzip(path, output_dir));
FilePath evil_file = output_dir;
evil_file = evil_file.AppendASCII("../evil.txt");
ASSERT_FALSE(file_util::PathExists(evil_file));
« no previous file with comments | « chrome/common/zip_reader_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698