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 "chrome/browser/extensions/extension_action_icon_factory.h" | 5 #include "chrome/browser/extensions/extension_action_icon_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 142 } |
143 | 143 |
144 void TearDown() override { | 144 void TearDown() override { |
145 profile_.reset(); // Get all DeleteSoon calls sent to ui_loop_. | 145 profile_.reset(); // Get all DeleteSoon calls sent to ui_loop_. |
146 ui_loop_.RunUntilIdle(); | 146 ui_loop_.RunUntilIdle(); |
147 } | 147 } |
148 | 148 |
149 // ExtensionActionIconFactory::Observer overrides: | 149 // ExtensionActionIconFactory::Observer overrides: |
150 void OnIconUpdated() override { | 150 void OnIconUpdated() override { |
151 if (quit_in_icon_updated_) | 151 if (quit_in_icon_updated_) |
152 base::MessageLoop::current()->Quit(); | 152 base::MessageLoop::current()->QuitWhenIdle(); |
153 } | 153 } |
154 | 154 |
155 gfx::ImageSkia GetFavicon() { | 155 gfx::ImageSkia GetFavicon() { |
156 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 156 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
157 IDR_EXTENSIONS_FAVICON); | 157 IDR_EXTENSIONS_FAVICON); |
158 } | 158 } |
159 | 159 |
160 ExtensionAction* GetBrowserAction(const Extension& extension) { | 160 ExtensionAction* GetBrowserAction(const Extension& extension) { |
161 return ExtensionActionManager::Get(profile())->GetBrowserAction(extension); | 161 return ExtensionActionManager::Get(profile())->GetBrowserAction(extension); |
162 } | 162 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 icon = icon_factory.GetIcon(1); | 292 icon = icon_factory.GetIcon(1); |
293 | 293 |
294 EXPECT_TRUE(ImageRepsAreEqual( | 294 EXPECT_TRUE(ImageRepsAreEqual( |
295 default_icon.ToImageSkia()->GetRepresentation(1.0f), | 295 default_icon.ToImageSkia()->GetRepresentation(1.0f), |
296 icon.ToImageSkia()->GetRepresentation(1.0f))); | 296 icon.ToImageSkia()->GetRepresentation(1.0f))); |
297 | 297 |
298 } | 298 } |
299 | 299 |
300 } // namespace | 300 } // namespace |
301 } // namespace extensions | 301 } // namespace extensions |
OLD | NEW |