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

Unified Diff: chrome/installer/util/delete_reg_key_work_item_unittest.cc

Issue 1878313003: Convert //chrome/installer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert decompress.cc in mini_installer. 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
Index: chrome/installer/util/delete_reg_key_work_item_unittest.cc
diff --git a/chrome/installer/util/delete_reg_key_work_item_unittest.cc b/chrome/installer/util/delete_reg_key_work_item_unittest.cc
index 19bf03ad14a2a6a296f1199d5e8f6a36e803ee0f..65bfdc7d87591fb7a4038236fd9c3dfbcc1ccf34 100644
--- a/chrome/installer/util/delete_reg_key_work_item_unittest.cc
+++ b/chrome/installer/util/delete_reg_key_work_item_unittest.cc
@@ -2,15 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/installer/util/delete_reg_key_work_item.h"
+
#include <windows.h>
#include <atlsecurity.h> // NOLINT
#include <stddef.h>
+#include <memory>
+
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/win/registry.h"
-#include "chrome/installer/util/delete_reg_key_work_item.h"
#include "chrome/installer/util/registry_test_data.h"
#include "chrome/installer/util/work_item.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -40,8 +42,9 @@ TEST_F(DeleteRegKeyWorkItemTest, TestNoKey) {
RegKey key;
for (size_t i = 0; i < arraysize(key_paths); ++i) {
const std::wstring& key_path = key_paths[i];
- scoped_ptr<DeleteRegKeyWorkItem> item(WorkItem::CreateDeleteRegKeyWorkItem(
- test_data_.root_key(), key_path, WorkItem::kWow64Default));
+ std::unique_ptr<DeleteRegKeyWorkItem> item(
+ WorkItem::CreateDeleteRegKeyWorkItem(test_data_.root_key(), key_path,
+ WorkItem::kWow64Default));
EXPECT_TRUE(item->Do());
EXPECT_NE(ERROR_SUCCESS, key.Open(test_data_.root_key(), key_path.c_str(),
KEY_READ));
@@ -56,8 +59,9 @@ TEST_F(DeleteRegKeyWorkItemTest, TestNoKey) {
TEST_F(DeleteRegKeyWorkItemTest, TestEmptyKey) {
RegKey key;
const std::wstring& key_path = test_data_.empty_key_path();
- scoped_ptr<DeleteRegKeyWorkItem> item(WorkItem::CreateDeleteRegKeyWorkItem(
- test_data_.root_key(), key_path, WorkItem::kWow64Default));
+ std::unique_ptr<DeleteRegKeyWorkItem> item(
+ WorkItem::CreateDeleteRegKeyWorkItem(test_data_.root_key(), key_path,
+ WorkItem::kWow64Default));
EXPECT_TRUE(item->Do());
EXPECT_NE(ERROR_SUCCESS, key.Open(test_data_.root_key(), key_path.c_str(),
KEY_READ));
@@ -72,8 +76,9 @@ TEST_F(DeleteRegKeyWorkItemTest, TestEmptyKey) {
TEST_F(DeleteRegKeyWorkItemTest, TestNonEmptyKey) {
RegKey key;
const std::wstring& key_path = test_data_.non_empty_key_path();
- scoped_ptr<DeleteRegKeyWorkItem> item(WorkItem::CreateDeleteRegKeyWorkItem(
- test_data_.root_key(), key_path, WorkItem::kWow64Default));
+ std::unique_ptr<DeleteRegKeyWorkItem> item(
+ WorkItem::CreateDeleteRegKeyWorkItem(test_data_.root_key(), key_path,
+ WorkItem::kWow64Default));
EXPECT_TRUE(item->Do());
EXPECT_NE(ERROR_SUCCESS, key.Open(test_data_.root_key(), key_path.c_str(),
KEY_READ));
@@ -115,8 +120,9 @@ TEST_F(DeleteRegKeyWorkItemTest, DISABLED_TestUndeletableKey) {
subkey2.Close();
subkey.Close();
key.Close();
- scoped_ptr<DeleteRegKeyWorkItem> item(WorkItem::CreateDeleteRegKeyWorkItem(
- test_data_.root_key(), key_name, WorkItem::kWow64Default));
+ std::unique_ptr<DeleteRegKeyWorkItem> item(
+ WorkItem::CreateDeleteRegKeyWorkItem(test_data_.root_key(), key_name,
+ WorkItem::kWow64Default));
EXPECT_FALSE(item->Do());
EXPECT_EQ(ERROR_SUCCESS, key.Open(test_data_.root_key(), key_name.c_str(),
KEY_QUERY_VALUE));

Powered by Google App Engine
This is Rietveld 408576698