OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/image_loader.h" | 5 #include "extensions/browser/image_loader.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
12 #include "content/public/browser/notification_service.h" | 12 #include "content/public/browser/notification_service.h" |
13 #include "content/public/test/test_browser_thread.h" | 13 #include "content/public/test/test_browser_thread.h" |
14 #include "extensions/browser/extensions_browser_client.h" | 14 #include "extensions/browser/extensions_browser_client.h" |
15 #include "extensions/browser/notification_types.h" | 15 #include "extensions/browser/notification_types.h" |
16 #include "extensions/common/constants.h" | 16 #include "extensions/common/constants.h" |
17 #include "extensions/common/extension.h" | 17 #include "extensions/common/extension.h" |
18 #include "extensions/common/extension_icon_set.h" | 18 #include "extensions/common/extension_icon_set.h" |
19 #include "extensions/common/extension_paths.h" | 19 #include "extensions/common/extension_paths.h" |
20 #include "extensions/common/extension_resource.h" | 20 #include "extensions/common/extension_resource.h" |
21 #include "extensions/common/manifest.h" | 21 #include "extensions/common/manifest.h" |
22 #include "extensions/common/manifest_handlers/icons_handler.h" | 22 #include "extensions/common/manifest_handlers/icons_handler.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 #include "third_party/skia/include/core/SkBitmap.h" | 24 #include "third_party/skia/include/core/SkBitmap.h" |
| 25 #include "ui/gfx/geometry/size.h" |
25 #include "ui/gfx/image/image.h" | 26 #include "ui/gfx/image/image.h" |
26 #include "ui/gfx/image/image_family.h" | 27 #include "ui/gfx/image/image_family.h" |
27 #include "ui/gfx/image/image_skia.h" | 28 #include "ui/gfx/image/image_skia.h" |
28 #include "ui/gfx/size.h" | |
29 | 29 |
30 using content::BrowserThread; | 30 using content::BrowserThread; |
31 using content::NotificationService; | 31 using content::NotificationService; |
32 | 32 |
33 namespace extensions { | 33 namespace extensions { |
34 | 34 |
35 class ImageLoaderTest : public testing::Test { | 35 class ImageLoaderTest : public testing::Test { |
36 public: | 36 public: |
37 ImageLoaderTest() | 37 ImageLoaderTest() |
38 : image_loaded_count_(0), | 38 : image_loaded_count_(0), |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 304 |
305 const gfx::ImageSkiaRep* img_rep1 = &image_reps[0]; | 305 const gfx::ImageSkiaRep* img_rep1 = &image_reps[0]; |
306 const gfx::ImageSkiaRep* img_rep2 = &image_reps[1]; | 306 const gfx::ImageSkiaRep* img_rep2 = &image_reps[1]; |
307 EXPECT_EQ(extension_misc::EXTENSION_ICON_BITTY, img_rep1->pixel_width()); | 307 EXPECT_EQ(extension_misc::EXTENSION_ICON_BITTY, img_rep1->pixel_width()); |
308 EXPECT_EQ(1.0f, img_rep1->scale()); | 308 EXPECT_EQ(1.0f, img_rep1->scale()); |
309 EXPECT_EQ(extension_misc::EXTENSION_ICON_SMALLISH, img_rep2->pixel_width()); | 309 EXPECT_EQ(extension_misc::EXTENSION_ICON_SMALLISH, img_rep2->pixel_width()); |
310 EXPECT_EQ(2.0f, img_rep2->scale()); | 310 EXPECT_EQ(2.0f, img_rep2->scale()); |
311 } | 311 } |
312 | 312 |
313 } // namespace extensions | 313 } // namespace extensions |
OLD | NEW |