diff options
author | alecflett@chromium.org <alecflett@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-02 20:15:02 +0000 |
---|---|---|
committer | alecflett@chromium.org <alecflett@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-02 20:15:02 +0000 |
commit | 282c939d529085410368a0c477e72cc125836f30 (patch) | |
tree | 983a5777c11a35705bc55d9c41210e254b64f73a | |
parent | e8d81410c4c07865cd8d3aff22130466d89b7e9c (diff) | |
download | chromium_src-282c939d529085410368a0c477e72cc125836f30.zip chromium_src-282c939d529085410368a0c477e72cc125836f30.tar.gz chromium_src-282c939d529085410368a0c477e72cc125836f30.tar.bz2 |
Move components/zip to third_party/zip
Move components to zip as per the discussion here:
https://groups.google.com/a/chromium.org/d/topic/chromium-dev/MgbMTQCNzR0/discussion
BUG=
R=agl@chromium.org, gavinp@chromium.org, jam@chromium.org, joi@chromium.org
Review URL: https://codereview.chromium.org/14021015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197964 0039d316-1c4b-4281-b951-d872f2087c98
40 files changed, 68 insertions, 80 deletions
diff --git a/chrome/DEPS b/chrome/DEPS index 358576c..66a1c42 100644 --- a/chrome/DEPS +++ b/chrome/DEPS @@ -26,7 +26,6 @@ include_rules = [ "+chrome/test", "+components/sessions", "+components/visitedlink/common", - "+components/zip", "+content/public/common", "+content/public/test", "+content/test/gpu", @@ -50,6 +49,7 @@ include_rules = [ "+third_party/npapi", # NPAPI interface headers. "+third_party/skia", "+third_party/tcmalloc", + "+third_party/zlib/google", "+third_party/GTM", # Google Toolbox for Mac. "+ui", diff --git a/chrome/browser/chromeos/imageburner/burn_manager.cc b/chrome/browser/chromeos/imageburner/burn_manager.cc index c875b8d..133c06d 100644 --- a/chrome/browser/chromeos/imageburner/burn_manager.cc +++ b/chrome/browser/chromeos/imageburner/burn_manager.cc @@ -13,12 +13,12 @@ #include "chromeos/dbus/image_burner_client.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" -#include "components/zip/zip.h" #include "content/public/browser/browser_thread.h" #include "grit/generated_resources.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_status.h" +#include "third_party/zlib/google/zip.h" using content::BrowserThread; diff --git a/chrome/browser/component_updater/component_unpacker.cc b/chrome/browser/component_updater/component_unpacker.cc index 836b0c1..789448d 100644 --- a/chrome/browser/component_updater/component_unpacker.cc +++ b/chrome/browser/component_updater/component_unpacker.cc @@ -14,10 +14,10 @@ #include "base/strings/string_number_conversions.h" #include "chrome/browser/component_updater/component_updater_service.h" #include "chrome/common/extensions/extension_constants.h" -#include "components/zip/zip.h" #include "crypto/secure_hash.h" #include "crypto/signature_verifier.h" #include "extensions/common/crx_file.h" +#include "third_party/zlib/google/zip.h" using crypto::SecureHash; diff --git a/chrome/browser/extensions/extension_creator.cc b/chrome/browser/extensions/extension_creator.cc index b7724c0..6efc50c 100644 --- a/chrome/browser/extensions/extension_creator.cc +++ b/chrome/browser/extensions/extension_creator.cc @@ -16,12 +16,12 @@ #include "chrome/browser/extensions/extension_creator_filter.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_file_util.h" -#include "components/zip/zip.h" #include "crypto/rsa_private_key.h" #include "crypto/signature_creator.h" #include "extensions/common/crx_file.h" #include "extensions/common/id_util.h" #include "grit/generated_resources.h" +#include "third_party/zlib/google/zip.h" #include "ui/base/l10n/l10n_util.h" namespace { diff --git a/chrome/browser/feedback/feedback_data.cc b/chrome/browser/feedback/feedback_data.cc index 8c394d6..5967b76 100644 --- a/chrome/browser/feedback/feedback_data.cc +++ b/chrome/browser/feedback/feedback_data.cc @@ -20,7 +20,7 @@ #endif #if defined(OS_CHROMEOS) -#include "components/zip/zip.h" +#include "third_party/zlib/google/zip.h" #endif using content::BrowserThread; diff --git a/chrome/browser/safe_browsing/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection_service_unittest.cc index af98856..657e189 100644 --- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc +++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc @@ -23,7 +23,6 @@ #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/safe_browsing/signature_util.h" #include "chrome/common/safe_browsing/csd.pb.h" -#include "components/zip/zip.h" #include "content/public/test/mock_download_item.h" #include "content/public/test/test_browser_thread.h" #include "googleurl/src/gurl.h" @@ -32,6 +31,7 @@ #include "net/url_request/url_fetcher_delegate.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/zlib/google/zip.h" using ::testing::ContainerEq; using ::testing::DoAll; diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 477aabb..2e838333 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -50,6 +50,7 @@ '../third_party/libjingle/libjingle.gyp:libjingle', '../third_party/libxml/libxml.gyp:libxml', '../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h', + '../third_party/zlib/zlib.gyp:zip', '../third_party/zlib/zlib.gyp:minizip', '../third_party/zlib/zlib.gyp:zlib', '../ui/base/strings/ui_strings.gyp:ui_strings', diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index 4e0f569..c0d65c5 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -38,7 +38,6 @@ '<(DEPTH)/chrome/chrome_resources.gyp:theme_resources', '<(DEPTH)/chrome/common_constants.gyp:common_constants', '<(DEPTH)/components/components.gyp:visitedlink_common', - '<(DEPTH)/components/components.gyp:zip', '<(DEPTH)/content/content.gyp:content_common', '<(DEPTH)/net/net.gyp:net', '<(DEPTH)/skia/skia.gyp:skia', @@ -48,6 +47,7 @@ '<(DEPTH)/third_party/libxml/libxml.gyp:libxml', '<(DEPTH)/third_party/mt19937ar/mt19937ar.gyp:mt19937ar', '<(DEPTH)/third_party/sqlite/sqlite.gyp:sqlite', + '<(DEPTH)/third_party/zlib/zlib.gyp:zip', '<(DEPTH)/ui/ui.gyp:ui_resources', '<(DEPTH)/webkit/support/webkit_support.gyp:user_agent', ], diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi index f9b46bb..a71e6cb 100644 --- a/chrome/chrome_tests_unit.gypi +++ b/chrome/chrome_tests_unit.gypi @@ -1774,6 +1774,8 @@ '../skia/ext/vector_canvas_unittest.cc', '../testing/gtest_mac_unittest.mm', '../third_party/cld/encodings/compact_lang_det/compact_lang_det_unittest_small.cc', + '../third_party/zlib/google/zip_reader_unittest.cc', + '../third_party/zlib/google/zip_unittest.cc', '../tools/json_schema_compiler/test/additional_properties_unittest.cc', '../tools/json_schema_compiler/test/any_unittest.cc', '../tools/json_schema_compiler/test/arrays_unittest.cc', diff --git a/chrome/common/extensions/unpacker.cc b/chrome/common/extensions/unpacker.cc index 085bc86..0cf8d94 100644 --- a/chrome/common/extensions/unpacker.cc +++ b/chrome/common/extensions/unpacker.cc @@ -22,13 +22,13 @@ #include "chrome/common/extensions/extension_manifest_constants.h" #include "chrome/common/extensions/manifest.h" #include "chrome/common/url_constants.h" -#include "components/zip/zip.h" #include "content/public/common/common_param_traits.h" #include "extensions/common/constants.h" #include "grit/generated_resources.h" #include "ipc/ipc_message_utils.h" #include "net/base/file_stream.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "third_party/zlib/google/zip.h" #include "ui/base/l10n/l10n_util.h" #include "webkit/glue/image_decoder.h" diff --git a/chrome/common/safe_browsing/zip_analyzer.cc b/chrome/common/safe_browsing/zip_analyzer.cc index b49ab22..394520a 100644 --- a/chrome/common/safe_browsing/zip_analyzer.cc +++ b/chrome/common/safe_browsing/zip_analyzer.cc @@ -6,7 +6,7 @@ #include "base/logging.h" #include "chrome/common/safe_browsing/download_protection_util.h" -#include "components/zip/zip_reader.h" +#include "third_party/zlib/google/zip_reader.h" namespace safe_browsing { namespace zip_analyzer { diff --git a/chrome/test/webdriver/webdriver_capabilities_parser_unittest.cc b/chrome/test/webdriver/webdriver_capabilities_parser_unittest.cc index c7131a5..c9c0f2e 100644 --- a/chrome/test/webdriver/webdriver_capabilities_parser_unittest.cc +++ b/chrome/test/webdriver/webdriver_capabilities_parser_unittest.cc @@ -10,8 +10,8 @@ #include "chrome/common/chrome_switches.h" #include "chrome/test/webdriver/webdriver_capabilities_parser.h" #include "chrome/test/webdriver/webdriver_logging.h" -#include "components/zip/zip.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/zlib/google/zip.h" using base::DictionaryValue; using base::ListValue; diff --git a/chrome/test/webdriver/webdriver_util.cc b/chrome/test/webdriver/webdriver_util.cc index eba3916..274144c 100644 --- a/chrome/test/webdriver/webdriver_util.cc +++ b/chrome/test/webdriver/webdriver_util.cc @@ -20,7 +20,7 @@ #include "base/third_party/icu/icu_utf.h" #include "chrome/common/automation_id.h" #include "chrome/test/automation/automation_json_requests.h" -#include "components/zip/zip.h" +#include "third_party/zlib/google/zip.h" using base::DictionaryValue; using base::ListValue; diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc index 18e2dec..46a6c0e 100644 --- a/chrome/utility/chrome_content_utility_client.cc +++ b/chrome/utility/chrome_content_utility_client.cc @@ -34,11 +34,11 @@ #include "chrome/common/safe_browsing/zip_analyzer.h" #include "chrome/common/web_resource/web_resource_unpacker.h" #include "chrome/utility/profile_import_handler.h" -#include "components/zip/zip.h" #include "content/public/utility/utility_thread.h" #include "printing/backend/print_backend.h" #include "printing/page_range.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "third_party/zlib/google/zip.h" #include "ui/base/ui_base_switches.h" #include "ui/gfx/codec/jpeg_codec.h" #include "ui/gfx/rect.h" diff --git a/components/components.gyp b/components/components.gyp index 3f1fc22e..b6ea5b5 100644 --- a/components/components.gyp +++ b/components/components.gyp @@ -19,6 +19,5 @@ 'visitedlink.gypi', 'webdata.gypi', 'web_contents_delegate_android.gypi', - 'zip.gypi', ], } diff --git a/components/components_tests.gypi b/components/components_tests.gypi index 9919247..ea2d9f4 100644 --- a/components/components_tests.gypi +++ b/components/components_tests.gypi @@ -17,8 +17,6 @@ 'visitedlink/test/visitedlink_unittest.cc', 'webdata/encryptor/encryptor_password_mac_unittest.cc', 'webdata/encryptor/encryptor_unittest.cc', - 'zip/zip_reader_unittest.cc', - 'zip/zip_unittest.cc', ], 'include_dirs': [ '..', @@ -48,9 +46,6 @@ 'visitedlink_browser', 'visitedlink_renderer', '../content/content_resources.gyp:content_resources', - - # Dependencies of zip - 'zip', ], 'conditions': [ ['OS == "android" and gtest_target_type == "shared_library"', { diff --git a/components/zip.gypi b/components/zip.gypi deleted file mode 100644 index e983b59..0000000 --- a/components/zip.gypi +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -{ - 'targets': [ - { - 'target_name': 'zip', - 'type': 'static_library', - 'dependencies': [ - '../third_party/zlib/zlib.gyp:minizip', - ], - 'include_dirs': [ - '..', - ], - 'sources': [ - 'zip/zip.cc', - 'zip/zip.h', - 'zip/zip_internal.cc', - 'zip/zip_internal.h', - 'zip/zip_reader.cc', - 'zip/zip_reader.h', - ], - }, - ], -} diff --git a/components/zip/DEPS b/components/zip/DEPS deleted file mode 100644 index 200eaf8..0000000 --- a/components/zip/DEPS +++ /dev/null @@ -1,7 +0,0 @@ -include_rules = [ - # No need for a content dependency - and it's better to enforce it. - "-content", - - "+net/base", - "+third_party/zlib/contrib/minizip", -] diff --git a/third_party/zlib/google/DEPS b/third_party/zlib/google/DEPS new file mode 100644 index 0000000..6a2f02e --- /dev/null +++ b/third_party/zlib/google/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + "+net/base", +] diff --git a/components/zip/OWNERS b/third_party/zlib/google/OWNERS index ff93254..ff93254 100644 --- a/components/zip/OWNERS +++ b/third_party/zlib/google/OWNERS diff --git a/components/test/data/zip/create_test_zip.sh b/third_party/zlib/google/test/data/create_test_zip.sh index e19d675..e19d675 100755 --- a/components/test/data/zip/create_test_zip.sh +++ b/third_party/zlib/google/test/data/create_test_zip.sh diff --git a/components/test/data/zip/evil.zip b/third_party/zlib/google/test/data/evil.zip Binary files differindex 8fb908a..8fb908a 100644 --- a/components/test/data/zip/evil.zip +++ b/third_party/zlib/google/test/data/evil.zip diff --git a/components/test/data/zip/evil_via_absolute_file_name.zip b/third_party/zlib/google/test/data/evil_via_absolute_file_name.zip Binary files differindex 2415f81..2415f81 100644 --- a/components/test/data/zip/evil_via_absolute_file_name.zip +++ b/third_party/zlib/google/test/data/evil_via_absolute_file_name.zip diff --git a/components/test/data/zip/evil_via_invalid_utf8.zip b/third_party/zlib/google/test/data/evil_via_invalid_utf8.zip Binary files differindex 94b633e..94b633e 100644 --- a/components/test/data/zip/evil_via_invalid_utf8.zip +++ b/third_party/zlib/google/test/data/evil_via_invalid_utf8.zip diff --git a/components/test/data/zip/test.zip b/third_party/zlib/google/test/data/test.zip Binary files differindex 4bafe30..4bafe30 100644 --- a/components/test/data/zip/test.zip +++ b/third_party/zlib/google/test/data/test.zip diff --git a/components/test/data/zip/test/foo.txt b/third_party/zlib/google/test/data/test/foo.txt index 257cc56..257cc56 100644 --- a/components/test/data/zip/test/foo.txt +++ b/third_party/zlib/google/test/data/test/foo.txt diff --git a/components/test/data/zip/test/foo/bar.txt b/third_party/zlib/google/test/data/test/foo/bar.txt index 5716ca5..5716ca5 100644 --- a/components/test/data/zip/test/foo/bar.txt +++ b/third_party/zlib/google/test/data/test/foo/bar.txt diff --git a/components/test/data/zip/test/foo/bar/.hidden b/third_party/zlib/google/test/data/test/foo/bar/.hidden index 136c05e..136c05e 100644 --- a/components/test/data/zip/test/foo/bar/.hidden +++ b/third_party/zlib/google/test/data/test/foo/bar/.hidden diff --git a/components/test/data/zip/test/foo/bar/baz.txt b/third_party/zlib/google/test/data/test/foo/bar/baz.txt index 7601807..7601807 100644 --- a/components/test/data/zip/test/foo/bar/baz.txt +++ b/third_party/zlib/google/test/data/test/foo/bar/baz.txt diff --git a/components/test/data/zip/test/foo/bar/quux.txt b/third_party/zlib/google/test/data/test/foo/bar/quux.txt index 4797879..4797879 100644 --- a/components/test/data/zip/test/foo/bar/quux.txt +++ b/third_party/zlib/google/test/data/test/foo/bar/quux.txt diff --git a/components/test/data/zip/test_nocompress.zip b/third_party/zlib/google/test/data/test_nocompress.zip Binary files differindex 25d66c2..25d66c2 100644 --- a/components/test/data/zip/test_nocompress.zip +++ b/third_party/zlib/google/test/data/test_nocompress.zip diff --git a/components/zip/zip.cc b/third_party/zlib/google/zip.cc index 7521641..e24449b 100644 --- a/components/zip/zip.cc +++ b/third_party/zlib/google/zip.cc @@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/zip/zip.h" +#include "third_party/zlib/google/zip.h" #include "base/bind.h" #include "base/file_util.h" #include "base/logging.h" #include "base/string16.h" #include "base/string_util.h" -#include "components/zip/zip_internal.h" -#include "components/zip/zip_reader.h" #include "net/base/file_stream.h" +#include "third_party/zlib/google/zip_internal.h" +#include "third_party/zlib/google/zip_reader.h" #if defined(USE_SYSTEM_MINIZIP) #include <minizip/unzip.h> diff --git a/components/zip/zip.h b/third_party/zlib/google/zip.h index a997c9c..9809fce 100644 --- a/components/zip/zip.h +++ b/third_party/zlib/google/zip.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_ZIP_ZIP_H_ -#define COMPONENTS_ZIP_ZIP_H_ +#ifndef THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_ +#define THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_ #include "base/callback.h" #include "base/files/file_path.h" @@ -41,4 +41,4 @@ bool Unzip(const base::FilePath& zip_file, const base::FilePath& dest_dir); } // namespace zip -#endif // COMPONENTS_ZIP_ZIP_H_ +#endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_H_ diff --git a/components/zip/zip_internal.cc b/third_party/zlib/google/zip_internal.cc index 56bca5e9..3a3a51a 100644 --- a/components/zip/zip_internal.cc +++ b/third_party/zlib/google/zip_internal.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/zip/zip.h" +#include "third_party/zlib/google/zip.h" #include <algorithm> diff --git a/components/zip/zip_internal.h b/third_party/zlib/google/zip_internal.h index 4f1ea4f..57894be 100644 --- a/components/zip/zip_internal.h +++ b/third_party/zlib/google/zip_internal.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_ZIP_ZIP_INTERNAL_H_ -#define COMPONENTS_ZIP_ZIP_INTERNAL_H_ +#ifndef THIRD_PARTY_ZLIB_GOOGLE_ZIP_INTERNAL_H_ +#define THIRD_PARTY_ZLIB_GOOGLE_ZIP_INTERNAL_H_ #if defined(OS_WIN) #include <windows.h> @@ -59,4 +59,4 @@ const int kZipBufSize = 8192; } // namespace internal } // namespace zip -#endif // COMPONENTS_ZIP_ZIP_INTERNAL_H_ +#endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_INTERNAL_H_ diff --git a/components/zip/zip_reader.cc b/third_party/zlib/google/zip_reader.cc index 9cb3695..5433b04 100644 --- a/components/zip/zip_reader.cc +++ b/third_party/zlib/google/zip_reader.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/zip/zip_reader.h" +#include "third_party/zlib/google/zip_reader.h" #include "base/file_util.h" #include "base/logging.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "components/zip/zip_internal.h" #include "net/base/file_stream.h" +#include "third_party/zlib/google/zip_internal.h" #if defined(USE_SYSTEM_MINIZIP) #include <minizip/unzip.h> diff --git a/components/zip/zip_reader.h b/third_party/zlib/google/zip_reader.h index 0bb171c..4064da4 100644 --- a/components/zip/zip_reader.h +++ b/third_party/zlib/google/zip_reader.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_ZIP_ZIP_READER_H_ -#define COMPONENTS_ZIP_ZIP_READER_H_ +#ifndef THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ +#define THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ #include <string> @@ -174,4 +174,4 @@ class ZipReader { } // namespace zip -#endif // COMPONENTS_ZIP_ZIP_READER_H_ +#endif // THIRD_PARTY_ZLIB_GOOGLE_ZIP_READER_H_ diff --git a/components/zip/zip_reader_unittest.cc b/third_party/zlib/google/zip_reader_unittest.cc index 0b4b554..a12b04e 100644 --- a/components/zip/zip_reader_unittest.cc +++ b/third_party/zlib/google/zip_reader_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/zip/zip_reader.h" +#include "third_party/zlib/google/zip_reader.h" #include <set> #include <string> @@ -15,9 +15,9 @@ #include "base/platform_file.h" #include "base/time.h" #include "base/utf_string_conversions.h" -#include "components/zip/zip_internal.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" +#include "third_party/zlib/google/zip_internal.h" namespace { @@ -75,7 +75,6 @@ class ZipReaderTest : public PlatformTest { test_dir_ = temp_dir_.path(); ASSERT_TRUE(GetTestDataDirectory(&test_data_dir_)); - test_data_dir_ = test_data_dir_.AppendASCII("zip"); test_zip_file_ = test_data_dir_.AppendASCII("test.zip"); evil_zip_file_ = test_data_dir_.AppendASCII("evil.zip"); @@ -106,7 +105,9 @@ class ZipReaderTest : public PlatformTest { EXPECT_TRUE(success); if (!success) return false; - *path = path->AppendASCII("components"); + *path = path->AppendASCII("third_party"); + *path = path->AppendASCII("zlib"); + *path = path->AppendASCII("google"); *path = path->AppendASCII("test"); *path = path->AppendASCII("data"); return true; diff --git a/components/zip/zip_unittest.cc b/third_party/zlib/google/zip_unittest.cc index b314e8c..3f7911e 100644 --- a/components/zip/zip_unittest.cc +++ b/third_party/zlib/google/zip_unittest.cc @@ -10,10 +10,10 @@ #include "base/files/scoped_temp_dir.h" #include "base/path_service.h" #include "base/string_util.h" -#include "components/zip/zip.h" -#include "components/zip/zip_reader.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" +#include "third_party/zlib/google/zip.h" +#include "third_party/zlib/google/zip_reader.h" namespace { @@ -54,7 +54,9 @@ class ZipTest : public PlatformTest { EXPECT_TRUE(success); if (!success) return false; - *path = path->AppendASCII("components"); + *path = path->AppendASCII("third_party"); + *path = path->AppendASCII("zlib"); + *path = path->AppendASCII("google"); *path = path->AppendASCII("test"); *path = path->AppendASCII("data"); return true; @@ -64,7 +66,6 @@ class ZipTest : public PlatformTest { bool expect_hidden_files) { base::FilePath test_dir; ASSERT_TRUE(GetTestDataDirectory(&test_dir)); - test_dir = test_dir.AppendASCII("zip"); TestUnzipFile(test_dir.Append(filename), expect_hidden_files); } @@ -120,7 +121,7 @@ TEST_F(ZipTest, UnzipUncompressed) { TEST_F(ZipTest, UnzipEvil) { base::FilePath path; ASSERT_TRUE(GetTestDataDirectory(&path)); - path = path.AppendASCII("zip").AppendASCII("evil.zip"); + path = path.AppendASCII("evil.zip"); // Unzip the zip file into a sub directory of test_dir_ so evil.zip // won't create a persistent file outside test_dir_ in case of a // failure. @@ -137,7 +138,7 @@ TEST_F(ZipTest, UnzipEvil2) { ASSERT_TRUE(GetTestDataDirectory(&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"); + path = path.AppendASCII("evil_via_invalid_utf8.zip"); // See the comment at UnzipEvil() for why we do this. base::FilePath output_dir = test_dir_.AppendASCII("out"); // This should fail as it contains an evil file. @@ -150,7 +151,7 @@ TEST_F(ZipTest, UnzipEvil2) { TEST_F(ZipTest, Zip) { base::FilePath src_dir; ASSERT_TRUE(GetTestDataDirectory(&src_dir)); - src_dir = src_dir.AppendASCII("zip").AppendASCII("test"); + src_dir = src_dir.AppendASCII("test"); base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); @@ -163,7 +164,7 @@ TEST_F(ZipTest, Zip) { TEST_F(ZipTest, ZipIgnoreHidden) { base::FilePath src_dir; ASSERT_TRUE(GetTestDataDirectory(&src_dir)); - src_dir = src_dir.AppendASCII("zip").AppendASCII("test"); + src_dir = src_dir.AppendASCII("test"); base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); @@ -177,7 +178,7 @@ TEST_F(ZipTest, ZipIgnoreHidden) { TEST_F(ZipTest, ZipFiles) { base::FilePath src_dir; ASSERT_TRUE(GetTestDataDirectory(&src_dir)); - src_dir = src_dir.AppendASCII("zip").AppendASCII("test"); + src_dir = src_dir.AppendASCII("test"); base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); diff --git a/third_party/zlib/zlib.gyp b/third_party/zlib/zlib.gyp index 069fb63..ebdad42 100644 --- a/third_party/zlib/zlib.gyp +++ b/third_party/zlib/zlib.gyp @@ -106,6 +106,25 @@ ], }], ], - } + }, + { + 'target_name': 'zip', + 'type': 'static_library', + 'dependencies': [ + 'minizip', + '../../base/base.gyp:base', + ], + 'include_dirs': [ + '../..', + ], + 'sources': [ + 'google/zip.cc', + 'google/zip.h', + 'google/zip_internal.cc', + 'google/zip_internal.h', + 'google/zip_reader.cc', + 'google/zip_reader.h', + ], + }, ], } |