| 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 "chrome/browser/ui/toolbar/toolbar_actions_model.h" | 5 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 return testing::AssertionSuccess(); | 261 return testing::AssertionSuccess(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 testing::AssertionResult ToolbarActionsModelUnitTest::RemoveExtension( | 264 testing::AssertionResult ToolbarActionsModelUnitTest::RemoveExtension( |
| 265 const scoped_refptr<const extensions::Extension>& extension) { | 265 const scoped_refptr<const extensions::Extension>& extension) { |
| 266 if (!registry()->enabled_extensions().GetByID(extension->id())) { | 266 if (!registry()->enabled_extensions().GetByID(extension->id())) { |
| 267 return testing::AssertionFailure() << "Extension " << extension->name() | 267 return testing::AssertionFailure() << "Extension " << extension->name() |
| 268 << " not installed!"; | 268 << " not installed!"; |
| 269 } | 269 } |
| 270 service()->UnloadExtension(extension->id(), | 270 service()->UnloadExtension(extension->id(), |
| 271 extensions::UnloadedExtensionInfo::REASON_DISABLE); | 271 extensions::UnloadedExtensionReason::DISABLE); |
| 272 if (registry()->enabled_extensions().GetByID(extension->id())) { | 272 if (registry()->enabled_extensions().GetByID(extension->id())) { |
| 273 return testing::AssertionFailure() << "Failed to unload extension: " | 273 return testing::AssertionFailure() << "Failed to unload extension: " |
| 274 << extension->name(); | 274 << extension->name(); |
| 275 } | 275 } |
| 276 return testing::AssertionSuccess(); | 276 return testing::AssertionSuccess(); |
| 277 } | 277 } |
| 278 | 278 |
| 279 testing::AssertionResult ToolbarActionsModelUnitTest::AddActionExtensions() { | 279 testing::AssertionResult ToolbarActionsModelUnitTest::AddActionExtensions() { |
| 280 browser_action_extension_ = | 280 browser_action_extension_ = |
| 281 extensions::extension_action_test_util::CreateActionExtension( | 281 extensions::extension_action_test_util::CreateActionExtension( |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1464 InitializeEmptyExtensionService(); | 1464 InitializeEmptyExtensionService(); |
| 1465 ToolbarActionsModel* toolbar_model = extensions::extension_action_test_util:: | 1465 ToolbarActionsModel* toolbar_model = extensions::extension_action_test_util:: |
| 1466 CreateToolbarModelForProfileWithoutWaitingForReady(profile()); | 1466 CreateToolbarModelForProfileWithoutWaitingForReady(profile()); |
| 1467 ASSERT_FALSE(toolbar_model->actions_initialized()); | 1467 ASSERT_FALSE(toolbar_model->actions_initialized()); |
| 1468 | 1468 |
| 1469 // AddComponentAction() should be a no-op if actions_initialized() is false. | 1469 // AddComponentAction() should be a no-op if actions_initialized() is false. |
| 1470 toolbar_model->AddComponentAction(component_action_id()); | 1470 toolbar_model->AddComponentAction(component_action_id()); |
| 1471 EXPECT_EQ(0u, toolbar_model->toolbar_items().size()); | 1471 EXPECT_EQ(0u, toolbar_model->toolbar_items().size()); |
| 1472 EXPECT_FALSE(toolbar_model->HasComponentAction(component_action_id())); | 1472 EXPECT_FALSE(toolbar_model->HasComponentAction(component_action_id())); |
| 1473 } | 1473 } |
| OLD | NEW |