Index: extensions/browser/image_loader_unittest.cc |
diff --git a/chrome/browser/extensions/image_loader_unittest.cc b/extensions/browser/image_loader_unittest.cc |
similarity index 94% |
rename from chrome/browser/extensions/image_loader_unittest.cc |
rename to extensions/browser/image_loader_unittest.cc |
index 45cff827d7dc8d3d84affa51bcd4f600642d643b..557c4a7da873135b69062fde6595417e4d7b3d8f 100644 |
--- a/chrome/browser/extensions/image_loader_unittest.cc |
+++ b/extensions/browser/image_loader_unittest.cc |
@@ -2,15 +2,19 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/browser/extensions/image_loader.h" |
+#include "extensions/browser/image_loader.h" |
+#include "base/files/file_path.h" |
#include "base/json/json_file_value_serializer.h" |
#include "base/message_loop/message_loop.h" |
#include "base/path_service.h" |
+#include "base/strings/string_util.h" |
#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/common/chrome_paths.h" |
#include "content/public/browser/notification_service.h" |
#include "content/public/test/test_browser_thread.h" |
+#include "extensions/browser/component_extension_resource_manager.h" |
+#include "extensions/browser/extensions_browser_client.h" |
#include "extensions/common/constants.h" |
#include "extensions/common/extension.h" |
#include "extensions/common/extension_icon_set.h" |
@@ -19,12 +23,15 @@ |
#include "extensions/common/manifest_handlers/icons_handler.h" |
#include "testing/gtest/include/gtest/gtest.h" |
#include "third_party/skia/include/core/SkBitmap.h" |
-#include "ui/file_manager/grit/file_manager_resources.h" |
#include "ui/gfx/image/image.h" |
#include "ui/gfx/image/image_family.h" |
#include "ui/gfx/image/image_skia.h" |
#include "ui/gfx/size.h" |
+#if defined(OS_CHROMEOS) |
+#include "ui/file_manager/grit/file_manager_resources.h" |
+#endif |
+ |
using content::BrowserThread; |
using extensions::Extension; |
using extensions::ExtensionResource; |
@@ -316,7 +323,14 @@ TEST_F(ImageLoaderTest, LoadImageFamily) { |
} |
// Tests IsComponentExtensionResource function. |
+// TODO(mukai): move this to ChromeComponentExtensionResourceManager's test. |
TEST_F(ImageLoaderTest, IsComponentExtensionResource) { |
+ extensions::ComponentExtensionResourceManager* resource_manager = |
+ extensions::ExtensionsBrowserClient::Get()-> |
+ GetComponentExtensionResourceManager(); |
+ if (!resource_manager) |
+ return; |
+ |
scoped_refptr<Extension> extension(CreateExtension( |
"file_manager", Manifest::COMPONENT)); |
ASSERT_TRUE(extension.get() != NULL); |
@@ -328,10 +342,10 @@ TEST_F(ImageLoaderTest, IsComponentExtensionResource) { |
#if defined(OS_CHROMEOS) |
int resource_id; |
- ASSERT_EQ(true, |
- ImageLoader::IsComponentExtensionResource(extension->path(), |
- resource.relative_path(), |
- &resource_id)); |
+ ASSERT_TRUE(resource_manager->IsComponentExtensionResource( |
+ extension->path(), |
+ resource.relative_path(), |
+ &resource_id)); |
ASSERT_EQ(IDR_FILE_MANAGER_ICON_16, resource_id); |
#endif |
} |