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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 scoped_refptr<Extension> extension = | 122 scoped_refptr<Extension> extension = |
123 Extension::Create(test_file, location, *valid_value, | 123 Extension::Create(test_file, location, *valid_value, |
124 Extension::NO_FLAGS, &error); | 124 Extension::NO_FLAGS, &error); |
125 EXPECT_TRUE(extension.get()) << error; | 125 EXPECT_TRUE(extension.get()) << error; |
126 if (extension.get()) | 126 if (extension.get()) |
127 extension_service_->AddExtension(extension.get()); | 127 extension_service_->AddExtension(extension.get()); |
128 return extension; | 128 return extension; |
129 } | 129 } |
130 | 130 |
131 // testing::Test overrides: | 131 // testing::Test overrides: |
132 virtual void SetUp() OVERRIDE { | 132 virtual void SetUp() override { |
133 file_thread_.Start(); | 133 file_thread_.Start(); |
134 io_thread_.Start(); | 134 io_thread_.Start(); |
135 profile_.reset(new TestingProfile); | 135 profile_.reset(new TestingProfile); |
136 CommandLine command_line(CommandLine::NO_PROGRAM); | 136 CommandLine command_line(CommandLine::NO_PROGRAM); |
137 extension_service_ = static_cast<extensions::TestExtensionSystem*>( | 137 extension_service_ = static_cast<extensions::TestExtensionSystem*>( |
138 extensions::ExtensionSystem::Get(profile_.get()))-> | 138 extensions::ExtensionSystem::Get(profile_.get()))-> |
139 CreateExtensionService(&command_line, base::FilePath(), false); | 139 CreateExtensionService(&command_line, base::FilePath(), false); |
140 } | 140 } |
141 | 141 |
142 virtual void TearDown() OVERRIDE { | 142 virtual void TearDown() override { |
143 profile_.reset(); // Get all DeleteSoon calls sent to ui_loop_. | 143 profile_.reset(); // Get all DeleteSoon calls sent to ui_loop_. |
144 ui_loop_.RunUntilIdle(); | 144 ui_loop_.RunUntilIdle(); |
145 } | 145 } |
146 | 146 |
147 // ExtensionActionIconFactory::Observer overrides: | 147 // ExtensionActionIconFactory::Observer overrides: |
148 virtual void OnIconUpdated() OVERRIDE { | 148 virtual void OnIconUpdated() override { |
149 if (quit_in_icon_updated_) | 149 if (quit_in_icon_updated_) |
150 base::MessageLoop::current()->Quit(); | 150 base::MessageLoop::current()->Quit(); |
151 } | 151 } |
152 | 152 |
153 gfx::ImageSkia GetFavicon() { | 153 gfx::ImageSkia GetFavicon() { |
154 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 154 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
155 IDR_EXTENSIONS_FAVICON); | 155 IDR_EXTENSIONS_FAVICON); |
156 } | 156 } |
157 | 157 |
158 ExtensionAction* GetBrowserAction(const Extension& extension) { | 158 ExtensionAction* GetBrowserAction(const Extension& extension) { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 icon = icon_factory.GetIcon(1); | 290 icon = icon_factory.GetIcon(1); |
291 | 291 |
292 EXPECT_TRUE(ImageRepsAreEqual( | 292 EXPECT_TRUE(ImageRepsAreEqual( |
293 default_icon.ToImageSkia()->GetRepresentation(1.0f), | 293 default_icon.ToImageSkia()->GetRepresentation(1.0f), |
294 icon.ToImageSkia()->GetRepresentation(1.0f))); | 294 icon.ToImageSkia()->GetRepresentation(1.0f))); |
295 | 295 |
296 } | 296 } |
297 | 297 |
298 } // namespace | 298 } // namespace |
299 } // namespace extensions | 299 } // namespace extensions |
OLD | NEW |