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

Side by Side Diff: chrome/browser/extensions/image_loader_unittest.cc

Issue 12253022: Manifest handler for all keys background-related. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/image_loader.h" 5 #include "chrome/browser/extensions/image_loader.h"
6 6
7 #include "base/json/json_file_value_serializer.h" 7 #include "base/json/json_file_value_serializer.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "chrome/common/chrome_notification_types.h" 10 #include "chrome/common/chrome_notification_types.h"
11 #include "chrome/common/chrome_paths.h" 11 #include "chrome/common/chrome_paths.h"
12 #include "chrome/common/extensions/api/icons/icons_handler.h" 12 #include "chrome/common/extensions/api/icons/icons_handler.h"
13 #include "chrome/common/extensions/extension.h" 13 #include "chrome/common/extensions/extension.h"
14 #include "chrome/common/extensions/extension_constants.h" 14 #include "chrome/common/extensions/extension_constants.h"
15 #include "chrome/common/extensions/extension_icon_set.h" 15 #include "chrome/common/extensions/extension_icon_set.h"
16 #include "chrome/common/extensions/extension_manifest_constants.h"
17 #include "chrome/common/extensions/extension_resource.h" 16 #include "chrome/common/extensions/extension_resource.h"
18 #include "chrome/common/extensions/manifest.h" 17 #include "chrome/common/extensions/manifest.h"
19 #include "chrome/common/extensions/manifest_handler.h" 18 #include "chrome/common/extensions/manifest_handler.h"
20 #include "content/public/browser/notification_service.h" 19 #include "content/public/browser/notification_service.h"
21 #include "content/public/test/test_browser_thread.h" 20 #include "content/public/test/test_browser_thread.h"
22 #include "grit/component_extension_resources.h" 21 #include "grit/component_extension_resources.h"
23 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
24 #include "third_party/skia/include/core/SkBitmap.h" 23 #include "third_party/skia/include/core/SkBitmap.h"
25 #include "ui/gfx/image/image.h" 24 #include "ui/gfx/image/image.h"
26 #include "ui/gfx/image/image_skia.h" 25 #include "ui/gfx/image/image_skia.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 92 }
94 return Extension::Create(test_file, location, *valid_value, 93 return Extension::Create(test_file, location, *valid_value,
95 Extension::NO_FLAGS, &error); 94 Extension::NO_FLAGS, &error);
96 } 95 }
97 96
98 gfx::Image image_; 97 gfx::Image image_;
99 98
100 private: 99 private:
101 virtual void SetUp() OVERRIDE { 100 virtual void SetUp() OVERRIDE {
102 testing::Test::SetUp(); 101 testing::Test::SetUp();
103 extensions::ManifestHandler::Register( 102 (new extensions::IconsHandler)->Register();
104 extension_manifest_keys::kIcons,
105 make_linked_ptr(new extensions::IconsHandler));
106 103
107 file_thread_.Start(); 104 file_thread_.Start();
108 io_thread_.Start(); 105 io_thread_.Start();
109 } 106 }
110 107
108 virtual void TearDown() OVERRIDE {
109 extensions::ManifestHandler::ClearRegistryForTesting();
110 }
111
111 int image_loaded_count_; 112 int image_loaded_count_;
112 bool quit_in_image_loaded_; 113 bool quit_in_image_loaded_;
113 MessageLoop ui_loop_; 114 MessageLoop ui_loop_;
114 content::TestBrowserThread ui_thread_; 115 content::TestBrowserThread ui_thread_;
115 content::TestBrowserThread file_thread_; 116 content::TestBrowserThread file_thread_;
116 content::TestBrowserThread io_thread_; 117 content::TestBrowserThread io_thread_;
117 }; 118 };
118 119
119 // Tests loading an image works correctly. 120 // Tests loading an image works correctly.
120 TEST_F(ImageLoaderTest, LoadImage) { 121 TEST_F(ImageLoaderTest, LoadImage) {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 257
257 #if defined(FILE_MANAGER_EXTENSION) 258 #if defined(FILE_MANAGER_EXTENSION)
258 int resource_id; 259 int resource_id;
259 ASSERT_EQ(true, 260 ASSERT_EQ(true,
260 ImageLoader::IsComponentExtensionResource(extension->path(), 261 ImageLoader::IsComponentExtensionResource(extension->path(),
261 resource.relative_path(), 262 resource.relative_path(),
262 &resource_id)); 263 &resource_id));
263 ASSERT_EQ(IDR_FILE_MANAGER_ICON_16, resource_id); 264 ASSERT_EQ(IDR_FILE_MANAGER_ICON_16, resource_id);
264 #endif 265 #endif
265 } 266 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/browser/extensions/lazy_background_task_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698