| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/extensions/component_migration_helper.h" | 10 #include "chrome/browser/extensions/component_migration_helper.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 const char kTestActionId[] = "toolbar-action"; | 28 const char kTestActionId[] = "toolbar-action"; |
| 29 | 29 |
| 30 class MockComponentActionDelegate | 30 class MockComponentActionDelegate |
| 31 : public ComponentMigrationHelper::ComponentActionDelegate { | 31 : public ComponentMigrationHelper::ComponentActionDelegate { |
| 32 public: | 32 public: |
| 33 MOCK_METHOD1(AddComponentAction, void(const std::string&)); | 33 MOCK_METHOD1(AddComponentAction, void(const std::string&)); |
| 34 MOCK_METHOD1(RemoveComponentAction, void(const std::string&)); | 34 MOCK_METHOD1(RemoveComponentAction, void(const std::string&)); |
| 35 MOCK_CONST_METHOD1(HasComponentAction, bool(const std::string&)); | 35 MOCK_CONST_METHOD1(HasComponentAction, bool(const std::string&)); |
| 36 MOCK_CONST_METHOD0(ActionsInitialized, bool()); |
| 36 }; | 37 }; |
| 37 | 38 |
| 38 class MockComponentMigrationHelper : public ComponentMigrationHelper { | 39 class MockComponentMigrationHelper : public ComponentMigrationHelper { |
| 39 public: | 40 public: |
| 40 MockComponentMigrationHelper(Profile* profile, | 41 MockComponentMigrationHelper(Profile* profile, |
| 41 ComponentActionDelegate* delegate) | 42 ComponentActionDelegate* delegate) |
| 42 : ComponentMigrationHelper(profile, delegate) {} | 43 : ComponentMigrationHelper(profile, delegate) {} |
| 43 | 44 |
| 44 ~MockComponentMigrationHelper() override{}; | 45 ~MockComponentMigrationHelper() override{}; |
| 45 | 46 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 204 |
| 204 EXPECT_CALL(mock_delegate_, HasComponentAction(kTestActionId)) | 205 EXPECT_CALL(mock_delegate_, HasComponentAction(kTestActionId)) |
| 205 .WillOnce(Return(true)); | 206 .WillOnce(Return(true)); |
| 206 EXPECT_CALL(mock_delegate_, RemoveComponentAction(kTestActionId)); | 207 EXPECT_CALL(mock_delegate_, RemoveComponentAction(kTestActionId)); |
| 207 | 208 |
| 208 mock_helper_->OnActionRemoved(kTestActionId); | 209 mock_helper_->OnActionRemoved(kTestActionId); |
| 209 EXPECT_FALSE(IsTestComponentActionEnabled()); | 210 EXPECT_FALSE(IsTestComponentActionEnabled()); |
| 210 } | 211 } |
| 211 | 212 |
| 212 } // namespace extensions | 213 } // namespace extensions |
| OLD | NEW |