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

Unified Diff: extensions/common/extension_resource_unittest.cc

Issue 12578008: Move CrxFile, FileReader, ExtensionResource to src/extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 | « extensions/common/extension_resource.cc ('k') | extensions/common/id_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/extension_resource_unittest.cc
diff --git a/chrome/common/extensions/extension_resource_unittest.cc b/extensions/common/extension_resource_unittest.cc
similarity index 92%
rename from chrome/common/extensions/extension_resource_unittest.cc
rename to extensions/common/extension_resource_unittest.cc
index f81cde256ed24fc0bb1f5bdc02459f177eba5e78..b2983eaad74239fac5a38f55cad76e6a3383aed6 100644
--- a/chrome/common/extensions/extension_resource_unittest.cc
+++ b/extensions/common/extension_resource_unittest.cc
@@ -8,13 +8,14 @@
#include "base/files/scoped_temp_dir.h"
#include "base/path_service.h"
#include "chrome/common/chrome_paths.h"
-#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_l10n_util.h"
-#include "chrome/common/extensions/extension_resource.h"
-#include "chrome/common/extensions/extension_test_util.h"
+#include "extensions/common/constants.h"
+#include "extensions/common/extension_resource.h"
+#include "extensions/common/id_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
+namespace extensions {
+
TEST(ExtensionResourceTest, CreateEmptyResource) {
ExtensionResource resource;
@@ -35,7 +36,7 @@ TEST(ExtensionResourceTest, CreateWithMissingResourceOnDisk) {
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &root_path));
base::FilePath relative_path;
relative_path = relative_path.AppendASCII("cira.js");
- std::string extension_id = extension_test_util::MakeId("test");
+ std::string extension_id = id_util::GenerateId("test");
ExtensionResource resource(extension_id, root_path, relative_path);
// The path doesn't exist on disk, we will be returned an empty path.
@@ -56,7 +57,7 @@ TEST(ExtensionResourceTest, ResourcesOutsideOfPath) {
base::FilePath outer_file = temp.path().AppendASCII("outer");
ASSERT_TRUE(file_util::WriteFile(outer_file, "X", 1));
ASSERT_TRUE(file_util::WriteFile(inner_file, "X", 1));
- std::string extension_id = extension_test_util::MakeId("test");
+ std::string extension_id = id_util::GenerateId("test");
#if defined(OS_POSIX)
base::FilePath symlink_file = inner_dir.AppendASCII("symlink");
@@ -126,7 +127,7 @@ TEST(ExtensionResourceTest, CreateWithAllResourcesOnDisk) {
// Create l10n resources (for current locale and its parents).
base::FilePath l10n_path =
- temp.path().Append(extensions::Extension::kLocaleFolder);
+ temp.path().Append(kLocaleFolder);
ASSERT_TRUE(file_util::CreateDirectory(l10n_path));
std::vector<std::string> locales;
@@ -141,7 +142,7 @@ TEST(ExtensionResourceTest, CreateWithAllResourcesOnDisk) {
}
base::FilePath path;
- std::string extension_id = extension_test_util::MakeId("test");
+ std::string extension_id = id_util::GenerateId("test");
ExtensionResource resource(extension_id, temp.path(),
base::FilePath().AppendASCII(filename));
base::FilePath resolved_path = resource.GetFilePath();
@@ -158,3 +159,5 @@ TEST(ExtensionResourceTest, CreateWithAllResourcesOnDisk) {
EXPECT_EQ(ToLower(base::FilePath().AppendASCII(filename).value()),
ToLower(resource.relative_path().value()));
}
+
+} // namespace extensions
« no previous file with comments | « extensions/common/extension_resource.cc ('k') | extensions/common/id_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698