Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: chrome/browser/extensions/component_migration_helper_unittest.cc

Issue 1612203002: [Media Router] Adds a contextual menu item to remove the MR component action. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to pkasting@ comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 registry()->enabled_extensions().Contains(migrated_extension_a_->id())); 184 registry()->enabled_extensions().Contains(migrated_extension_a_->id()));
185 } 185 }
186 186
187 TEST_F(ComponentMigrationHelperTest, InstallUnregisteredExtension) { 187 TEST_F(ComponentMigrationHelperTest, InstallUnregisteredExtension) {
188 service()->AddExtension(unregistered_extension_.get()); 188 service()->AddExtension(unregistered_extension_.get());
189 EXPECT_FALSE(IsTestComponentActionEnabled()); 189 EXPECT_FALSE(IsTestComponentActionEnabled());
190 EXPECT_TRUE( 190 EXPECT_TRUE(
191 registry()->enabled_extensions().Contains(unregistered_extension_->id())); 191 registry()->enabled_extensions().Contains(unregistered_extension_->id()));
192 } 192 }
193 193
194 TEST_F(ComponentMigrationHelperTest, RemoveComponentAction) {
195 mock_helper_->SetTestComponentActionPref(true);
196
197 EXPECT_CALL(mock_delegate_, HasComponentAction(kTestActionId))
198 .WillOnce(Return(false));
199 EXPECT_CALL(mock_delegate_, AddComponentAction(kTestActionId));
200
201 mock_helper_->OnFeatureEnabled(kTestActionId);
202 EXPECT_TRUE(IsTestComponentActionEnabled());
203
204 EXPECT_CALL(mock_delegate_, HasComponentAction(kTestActionId))
205 .WillOnce(Return(true));
206 EXPECT_CALL(mock_delegate_, RemoveComponentAction(kTestActionId));
207
208 mock_helper_->OnActionRemoved(kTestActionId);
209 EXPECT_FALSE(IsTestComponentActionEnabled());
210 }
211
194 } // namespace extensions 212 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/component_migration_helper.cc ('k') | chrome/browser/ui/toolbar/media_router_contextual_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698