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

Unified Diff: chrome/browser/extensions/menu_manager_unittest.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/menu_manager_factory.cc ('k') | chrome/browser/extensions/navigation_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/menu_manager_unittest.cc
diff --git a/chrome/browser/extensions/menu_manager_unittest.cc b/chrome/browser/extensions/menu_manager_unittest.cc
index e22aeb6e52cbb55f894a0bf352d9afa203533243..daac058a768f0ee6812cb7bc97585848a4818747 100644
--- a/chrome/browser/extensions/menu_manager_unittest.cc
+++ b/chrome/browser/extensions/menu_manager_unittest.cc
@@ -2,17 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/browser/extensions/menu_manager.h"
+
+#include <memory>
#include <vector>
#include "base/files/scoped_temp_dir.h"
#include "base/json/json_reader.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/extension_system_factory.h"
-#include "chrome/browser/extensions/menu_manager.h"
#include "chrome/browser/extensions/test_extension_prefs.h"
#include "chrome/browser/extensions/test_extension_system.h"
#include "chrome/common/chrome_paths.h"
@@ -93,7 +95,7 @@ class MenuManagerTest : public testing::Test {
base::MessageLoopForUI message_loop_;
content::TestBrowserThread ui_thread_;
content::TestBrowserThread file_thread_;
- scoped_ptr<TestingProfile> profile_;
+ std::unique_ptr<TestingProfile> profile_;
MenuManager manager_;
ExtensionList extensions_;
@@ -144,7 +146,7 @@ TEST_F(MenuManagerTest, AddGetRemoveItems) {
ASSERT_FALSE(manager_.RemoveContextMenuItem(id));
// Make sure adding an item with the same string ID returns false.
- scoped_ptr<MenuItem> item2too(CreateTestItemWithID(extension, "id2"));
+ std::unique_ptr<MenuItem> item2too(CreateTestItemWithID(extension, "id2"));
ASSERT_FALSE(manager_.AddContextItem(extension, item2too.get()));
// But the same string ID should not collide with another extension.
@@ -166,7 +168,7 @@ TEST_F(MenuManagerTest, ChildFunctions) {
// This third item we expect to fail inserting, so we use a scoped_ptr to make
// sure it gets deleted.
- scoped_ptr<MenuItem> item3(CreateTestItem(extension3));
+ std::unique_ptr<MenuItem> item3(CreateTestItem(extension3));
// Add in the first two items.
ASSERT_TRUE(manager_.AddContextItem(extension1, item1));
@@ -246,7 +248,8 @@ TEST_F(MenuManagerTest, PopulateFromValue) {
value.Set("target_url_patterns", target_url_patterns);
std::string error;
- scoped_ptr<MenuItem> item(MenuItem::Populate(extension->id(), value, &error));
+ std::unique_ptr<MenuItem> item(
+ MenuItem::Populate(extension->id(), value, &error));
ASSERT_TRUE(item.get());
EXPECT_EQ(extension->id(), item->extension_id());
@@ -469,7 +472,7 @@ class MockEventRouter : public EventRouter {
EventRouter::UserGestureState state));
virtual void DispatchEventToExtension(const std::string& extension_id,
- scoped_ptr<Event> event) {
+ std::unique_ptr<Event> event) {
DispatchEventToExtensionMock(extension_id,
event->event_name,
event->event_args.release(),
@@ -483,9 +486,9 @@ class MockEventRouter : public EventRouter {
};
// MockEventRouter factory function
-scoped_ptr<KeyedService> MockEventRouterFactoryFunction(
+std::unique_ptr<KeyedService> MockEventRouterFactoryFunction(
content::BrowserContext* context) {
- return make_scoped_ptr(new MockEventRouter(static_cast<Profile*>(context)));
+ return base::WrapUnique(new MockEventRouter(static_cast<Profile*>(context)));
}
} // namespace
« no previous file with comments | « chrome/browser/extensions/menu_manager_factory.cc ('k') | chrome/browser/extensions/navigation_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698