| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 profile()->GetPrefs()->GetDictionary( | 89 profile()->GetPrefs()->GetDictionary( |
| 90 ::prefs::kToolbarMigratedComponentActionStatus); | 90 ::prefs::kToolbarMigratedComponentActionStatus); |
| 91 if (!migration_pref->HasKey(kTestActionId)) | 91 if (!migration_pref->HasKey(kTestActionId)) |
| 92 return false; | 92 return false; |
| 93 bool enable_value = false; | 93 bool enable_value = false; |
| 94 CHECK(migration_pref->GetBoolean(kTestActionId, &enable_value)); | 94 CHECK(migration_pref->GetBoolean(kTestActionId, &enable_value)); |
| 95 return enable_value; | 95 return enable_value; |
| 96 } | 96 } |
| 97 | 97 |
| 98 StrictMock<MockComponentActionDelegate> mock_delegate_; | 98 StrictMock<MockComponentActionDelegate> mock_delegate_; |
| 99 scoped_ptr<StrictMock<MockComponentMigrationHelper>> mock_helper_; | 99 std::unique_ptr<StrictMock<MockComponentMigrationHelper>> mock_helper_; |
| 100 scoped_ptr<FeatureSwitch::ScopedOverride> extension_action_redesign_; | 100 std::unique_ptr<FeatureSwitch::ScopedOverride> extension_action_redesign_; |
| 101 | 101 |
| 102 // Migrated extensions with browser actions. | 102 // Migrated extensions with browser actions. |
| 103 scoped_refptr<const Extension> migrated_extension_a_; | 103 scoped_refptr<const Extension> migrated_extension_a_; |
| 104 scoped_refptr<const Extension> migrated_extension_b_; | 104 scoped_refptr<const Extension> migrated_extension_b_; |
| 105 // An extension that is not migrated. | 105 // An extension that is not migrated. |
| 106 scoped_refptr<const Extension> unregistered_extension_; | 106 scoped_refptr<const Extension> unregistered_extension_; |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 DISALLOW_COPY_AND_ASSIGN(ComponentMigrationHelperTest); | 109 DISALLOW_COPY_AND_ASSIGN(ComponentMigrationHelperTest); |
| 110 }; | 110 }; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 203 |
| 204 EXPECT_CALL(mock_delegate_, HasComponentAction(kTestActionId)) | 204 EXPECT_CALL(mock_delegate_, HasComponentAction(kTestActionId)) |
| 205 .WillOnce(Return(true)); | 205 .WillOnce(Return(true)); |
| 206 EXPECT_CALL(mock_delegate_, RemoveComponentAction(kTestActionId)); | 206 EXPECT_CALL(mock_delegate_, RemoveComponentAction(kTestActionId)); |
| 207 | 207 |
| 208 mock_helper_->OnActionRemoved(kTestActionId); | 208 mock_helper_->OnActionRemoved(kTestActionId); |
| 209 EXPECT_FALSE(IsTestComponentActionEnabled()); | 209 EXPECT_FALSE(IsTestComponentActionEnabled()); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace extensions | 212 } // namespace extensions |
| OLD | NEW |