OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/extensions/extension_icon_manager.h" | 8 #include "chrome/browser/extensions/extension_icon_manager.h" |
9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
11 #include "chrome/common/extensions/extension_resource.h" | 11 #include "chrome/common/extensions/extension_resource.h" |
12 #include "chrome/test/testing_browser_process_test.h" | 12 #include "chrome/test/base/testing_browser_process_test.h" |
13 #include "content/browser/browser_thread.h" | 13 #include "content/browser/browser_thread.h" |
14 #include "content/common/json_value_serializer.h" | 14 #include "content/common/json_value_serializer.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "ui/gfx/skia_util.h" | 16 #include "ui/gfx/skia_util.h" |
17 | 17 |
18 // Our test class that takes care of managing the necessary threads for loading | 18 // Our test class that takes care of managing the necessary threads for loading |
19 // extension icons, and waiting for those loads to happen. | 19 // extension icons, and waiting for those loads to happen. |
20 class ExtensionIconManagerTest : public TestingBrowserProcessTest { | 20 class ExtensionIconManagerTest : public TestingBrowserProcessTest { |
21 public: | 21 public: |
22 ExtensionIconManagerTest() : | 22 ExtensionIconManagerTest() : |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 // Now re-load the icon - we should get the same result bitmap (and not the | 128 // Now re-load the icon - we should get the same result bitmap (and not the |
129 // default icon). | 129 // default icon). |
130 icon_manager.LoadIcon(extension.get()); | 130 icon_manager.LoadIcon(extension.get()); |
131 WaitForImageLoad(); | 131 WaitForImageLoad(); |
132 SkBitmap second_icon = icon_manager.GetIcon(extension->id()); | 132 SkBitmap second_icon = icon_manager.GetIcon(extension->id()); |
133 EXPECT_FALSE(gfx::BitmapsAreEqual(second_icon, default_icon)); | 133 EXPECT_FALSE(gfx::BitmapsAreEqual(second_icon, default_icon)); |
134 | 134 |
135 EXPECT_TRUE(gfx::BitmapsAreEqual(first_icon, second_icon)); | 135 EXPECT_TRUE(gfx::BitmapsAreEqual(first_icon, second_icon)); |
136 } | 136 } |
OLD | NEW |