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

Unified Diff: components/zip/zip_reader_unittest.cc

Issue 13257004: [components] Make zip a component so that src/chromeos can use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DEPS, OWNERS Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/zip/zip_reader.cc ('k') | components/zip/zip_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/zip/zip_reader_unittest.cc
diff --git a/chrome/common/zip_reader_unittest.cc b/components/zip/zip_reader_unittest.cc
similarity index 97%
rename from chrome/common/zip_reader_unittest.cc
rename to components/zip/zip_reader_unittest.cc
index fdad562604e4e61f107050cee0f77b3df2a9be84..0b4b55499953b596ce587350085cbf80f8927a0e 100644
--- a/chrome/common/zip_reader_unittest.cc
+++ b/components/zip/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 "chrome/common/zip_reader.h"
+#include "components/zip/zip_reader.h"
#include <set>
#include <string>
@@ -15,8 +15,7 @@
#include "base/platform_file.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
-#include "chrome/common/chrome_paths.h"
-#include "chrome/common/zip_internal.h"
+#include "components/zip/zip_internal.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
@@ -75,7 +74,7 @@ class ZipReaderTest : public PlatformTest {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
test_dir_ = temp_dir_.path();
- ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_));
+ ASSERT_TRUE(GetTestDataDirectory(&test_data_dir_));
test_data_dir_ = test_data_dir_.AppendASCII("zip");
test_zip_file_ = test_data_dir_.AppendASCII("test.zip");
@@ -102,6 +101,17 @@ class ZipReaderTest : public PlatformTest {
PlatformTest::TearDown();
}
+ bool GetTestDataDirectory(base::FilePath* path) {
+ bool success = PathService::Get(base::DIR_SOURCE_ROOT, path);
+ EXPECT_TRUE(success);
+ if (!success)
+ return false;
+ *path = path->AppendASCII("components");
+ *path = path->AppendASCII("test");
+ *path = path->AppendASCII("data");
+ return true;
+ }
+
// The path to temporary directory used to contain the test operations.
base::FilePath test_dir_;
// The path to the test data directory where test.zip etc. are located.
« no previous file with comments | « components/zip/zip_reader.cc ('k') | components/zip/zip_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698