| OLD | NEW |
| 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 "base/json/json_file_value_serializer.h" | 5 #include "base/json/json_file_value_serializer.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/extensions/extension_icon_manager.h" | 9 #include "chrome/browser/extensions/extension_icon_manager.h" |
| 10 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
| 11 #include "chrome/common/extensions/extension.h" | |
| 12 #include "chrome/test/base/testing_profile.h" | 11 #include "chrome/test/base/testing_profile.h" |
| 13 #include "content/public/test/test_browser_thread.h" | 12 #include "content/public/test/test_browser_thread.h" |
| 13 #include "extensions/common/extension.h" |
| 14 #include "extensions/common/id_util.h" | 14 #include "extensions/common/id_util.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 using content::BrowserThread; | 18 using content::BrowserThread; |
| 19 using extensions::Extension; | 19 using extensions::Extension; |
| 20 using extensions::Manifest; | 20 using extensions::Manifest; |
| 21 | 21 |
| 22 // Our test class that takes care of managing the necessary threads for loading | 22 // Our test class that takes care of managing the necessary threads for loading |
| 23 // extension icons, and waiting for those loads to happen. | 23 // extension icons, and waiting for those loads to happen. |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // Now re-load the icon - we should get the same result bitmap (and not the | 174 // Now re-load the icon - we should get the same result bitmap (and not the |
| 175 // default icon). | 175 // default icon). |
| 176 icon_manager.LoadIcon(profile.get(), extension.get()); | 176 icon_manager.LoadIcon(profile.get(), extension.get()); |
| 177 WaitForImageLoad(); | 177 WaitForImageLoad(); |
| 178 SkBitmap second_icon = icon_manager.GetIcon(extension->id()); | 178 SkBitmap second_icon = icon_manager.GetIcon(extension->id()); |
| 179 EXPECT_FALSE(gfx::BitmapsAreEqual(second_icon, default_icon)); | 179 EXPECT_FALSE(gfx::BitmapsAreEqual(second_icon, default_icon)); |
| 180 | 180 |
| 181 EXPECT_TRUE(gfx::BitmapsAreEqual(first_icon, second_icon)); | 181 EXPECT_TRUE(gfx::BitmapsAreEqual(first_icon, second_icon)); |
| 182 } | 182 } |
| 183 #endif | 183 #endif |
| OLD | NEW |