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

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

Issue 2257113002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 (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 "chrome/browser/extensions/menu_manager.h" 5 #include "chrome/browser/extensions/menu_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 event->user_gesture); 477 event->user_gesture);
478 } 478 }
479 479
480 private: 480 private:
481 DISALLOW_COPY_AND_ASSIGN(MockEventRouter); 481 DISALLOW_COPY_AND_ASSIGN(MockEventRouter);
482 }; 482 };
483 483
484 // MockEventRouter factory function 484 // MockEventRouter factory function
485 std::unique_ptr<KeyedService> MockEventRouterFactoryFunction( 485 std::unique_ptr<KeyedService> MockEventRouterFactoryFunction(
486 content::BrowserContext* context) { 486 content::BrowserContext* context) {
487 return base::WrapUnique(new MockEventRouter(static_cast<Profile*>(context))); 487 return base::MakeUnique<MockEventRouter>(static_cast<Profile*>(context));
488 } 488 }
489 489
490 } // namespace 490 } // namespace
491 491
492 // Tests the RemoveAll functionality. 492 // Tests the RemoveAll functionality.
493 TEST_F(MenuManagerTest, RemoveAll) { 493 TEST_F(MenuManagerTest, RemoveAll) {
494 // Try removing all items for an extension id that doesn't have any items. 494 // Try removing all items for an extension id that doesn't have any items.
495 manager_.RemoveAllContextItems(MenuItem::ExtensionKey("CCCC")); 495 manager_.RemoveAllContextItems(MenuItem::ExtensionKey("CCCC"));
496 496
497 // Add 2 top-level and one child item for extension 1. 497 // Add 2 top-level and one child item for extension 1.
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 EXPECT_EQ(4u, manager_.MenuItems(key1)->size()); 744 EXPECT_EQ(4u, manager_.MenuItems(key1)->size());
745 EXPECT_EQ(1u, manager_.MenuItems(key2)->size()); 745 EXPECT_EQ(1u, manager_.MenuItems(key2)->size());
746 746
747 // Remove all context menu items with incognito true. 747 // Remove all context menu items with incognito true.
748 manager_.RemoveAllIncognitoContextItems(); 748 manager_.RemoveAllIncognitoContextItems();
749 EXPECT_EQ(2u, manager_.MenuItems(key1)->size()); 749 EXPECT_EQ(2u, manager_.MenuItems(key1)->size());
750 EXPECT_EQ(1u, manager_.MenuItems(key2)->size()); 750 EXPECT_EQ(1u, manager_.MenuItems(key2)->size());
751 } 751 }
752 752
753 } // namespace extensions 753 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_web_ui_unittest.cc ('k') | chrome/browser/extensions/navigation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698