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

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

Issue 197413002: Move extensions-related files to using //components/keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
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 <vector> 5 #include <vector>
6 6
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 mock_event_router_.reset(new MockEventRouter(profile_)); 491 mock_event_router_.reset(new MockEventRouter(profile_));
492 return mock_event_router_.get(); 492 return mock_event_router_.get();
493 } 493 }
494 494
495 private: 495 private:
496 scoped_ptr<MockEventRouter> mock_event_router_; 496 scoped_ptr<MockEventRouter> mock_event_router_;
497 497
498 DISALLOW_COPY_AND_ASSIGN(MockExtensionSystem); 498 DISALLOW_COPY_AND_ASSIGN(MockExtensionSystem);
499 }; 499 };
500 500
501 BrowserContextKeyedService* BuildMockExtensionSystem( 501 KeyedService* BuildMockExtensionSystem(content::BrowserContext* profile) {
502 content::BrowserContext* profile) {
503 return new MockExtensionSystem(static_cast<Profile*>(profile)); 502 return new MockExtensionSystem(static_cast<Profile*>(profile));
504 } 503 }
505 504
506 // Tests the RemoveAll functionality. 505 // Tests the RemoveAll functionality.
507 TEST_F(MenuManagerTest, RemoveAll) { 506 TEST_F(MenuManagerTest, RemoveAll) {
508 // Try removing all items for an extension id that doesn't have any items. 507 // Try removing all items for an extension id that doesn't have any items.
509 manager_.RemoveAllContextItems(MenuItem::ExtensionKey("CCCC")); 508 manager_.RemoveAllContextItems(MenuItem::ExtensionKey("CCCC"));
510 509
511 // Add 2 top-level and one child item for extension 1. 510 // Add 2 top-level and one child item for extension 1.
512 Extension* extension1 = AddExtension("1111"); 511 Extension* extension1 = AddExtension("1111");
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 EXPECT_EQ(4u, manager_.MenuItems(key1)->size()); 760 EXPECT_EQ(4u, manager_.MenuItems(key1)->size());
762 EXPECT_EQ(1u, manager_.MenuItems(key2)->size()); 761 EXPECT_EQ(1u, manager_.MenuItems(key2)->size());
763 762
764 // Remove all context menu items with incognito true. 763 // Remove all context menu items with incognito true.
765 manager_.RemoveAllIncognitoContextItems(); 764 manager_.RemoveAllIncognitoContextItems();
766 EXPECT_EQ(2u, manager_.MenuItems(key1)->size()); 765 EXPECT_EQ(2u, manager_.MenuItems(key1)->size());
767 EXPECT_EQ(1u, manager_.MenuItems(key2)->size()); 766 EXPECT_EQ(1u, manager_.MenuItems(key2)->size());
768 } 767 }
769 768
770 } // namespace extensions 769 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/menu_manager_factory.cc ('k') | chrome/browser/extensions/signin/gaia_auth_extension_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698