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

Unified Diff: chrome/installer/util/copy_tree_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/copy_tree_work_item_unittest.cc
diff --git a/chrome/installer/util/copy_tree_work_item_unittest.cc b/chrome/installer/util/copy_tree_work_item_unittest.cc
index 5d7a5e09772f73e713e3a3f51c21ec6a38474b33..bffdd151bc5f7976e7c5c6897c699f272b3f15c1 100644
--- a/chrome/installer/util/copy_tree_work_item_unittest.cc
+++ b/chrome/installer/util/copy_tree_work_item_unittest.cc
@@ -2,18 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/installer/util/copy_tree_work_item.h"
+
#include <windows.h>
#include <fstream>
+#include <memory>
#include "base/base_paths.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/string_util.h"
#include "base/threading/platform_thread.h"
-#include "chrome/installer/util/copy_tree_work_item.h"
#include "chrome/installer/util/work_item.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -90,12 +91,9 @@ TEST_F(CopyTreeWorkItemTest, CopyFile) {
file_name_to = file_name_to.AppendASCII("File_To.txt");
// test Do()
- scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from,
- file_name_to,
- temp_dir_.path(),
- WorkItem::ALWAYS,
- base::FilePath()));
+ std::unique_ptr<CopyTreeWorkItem> work_item(WorkItem::CreateCopyTreeWorkItem(
+ file_name_from, file_name_to, temp_dir_.path(), WorkItem::ALWAYS,
+ base::FilePath()));
EXPECT_TRUE(work_item->Do());
@@ -132,12 +130,9 @@ TEST_F(CopyTreeWorkItemTest, CopyFileOverwrite) {
ASSERT_TRUE(base::PathExists(file_name_to));
// test Do() with always_overwrite being true.
- scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from,
- file_name_to,
- temp_dir_.path(),
- WorkItem::ALWAYS,
- base::FilePath()));
+ std::unique_ptr<CopyTreeWorkItem> work_item(WorkItem::CreateCopyTreeWorkItem(
+ file_name_from, file_name_to, temp_dir_.path(), WorkItem::ALWAYS,
+ base::FilePath()));
EXPECT_TRUE(work_item->Do());
@@ -202,12 +197,9 @@ TEST_F(CopyTreeWorkItemTest, CopyFileSameContent) {
ASSERT_TRUE(base::PathExists(file_name_to));
// test Do() with always_overwrite being true.
- scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from,
- file_name_to,
- temp_dir_.path(),
- WorkItem::ALWAYS,
- base::FilePath()));
+ std::unique_ptr<CopyTreeWorkItem> work_item(WorkItem::CreateCopyTreeWorkItem(
+ file_name_from, file_name_to, temp_dir_.path(), WorkItem::ALWAYS,
+ base::FilePath()));
EXPECT_TRUE(work_item->Do());
@@ -286,12 +278,10 @@ TEST_F(CopyTreeWorkItemTest, CopyFileAndCleanup) {
{
// test Do().
- scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from,
- file_name_to,
- temp_dir_.path(),
- WorkItem::IF_DIFFERENT,
- base::FilePath()));
+ std::unique_ptr<CopyTreeWorkItem> work_item(
+ WorkItem::CreateCopyTreeWorkItem(
+ file_name_from, file_name_to, temp_dir_.path(),
+ WorkItem::IF_DIFFERENT, base::FilePath()));
EXPECT_TRUE(work_item->Do());
@@ -350,12 +340,9 @@ TEST_F(CopyTreeWorkItemTest, CopyFileInUse) {
NULL, NULL, &si, &pi));
// test Do().
- scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from,
- file_name_to,
- temp_dir_.path(),
- WorkItem::IF_DIFFERENT,
- base::FilePath()));
+ std::unique_ptr<CopyTreeWorkItem> work_item(WorkItem::CreateCopyTreeWorkItem(
+ file_name_from, file_name_to, temp_dir_.path(), WorkItem::IF_DIFFERENT,
+ base::FilePath()));
EXPECT_TRUE(work_item->Do());
@@ -430,12 +417,9 @@ TEST_F(CopyTreeWorkItemTest, NewNameAndCopyTest) {
NULL, NULL, &si, &pi));
// test Do().
- scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from,
- file_name_to,
- temp_dir_.path(),
- WorkItem::NEW_NAME_IF_IN_USE,
- alternate_to));
+ std::unique_ptr<CopyTreeWorkItem> work_item(WorkItem::CreateCopyTreeWorkItem(
+ file_name_from, file_name_to, temp_dir_.path(),
+ WorkItem::NEW_NAME_IF_IN_USE, alternate_to));
EXPECT_TRUE(work_item->Do());
@@ -532,12 +516,9 @@ TEST_F(CopyTreeWorkItemTest, DISABLED_IfNotPresentTest) {
backup_file = backup_file.AppendASCII("File_To");
// test Do().
- scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(
- file_name_from,
- file_name_to, temp_dir_.path(),
- WorkItem::IF_NOT_PRESENT,
- base::FilePath()));
+ std::unique_ptr<CopyTreeWorkItem> work_item(WorkItem::CreateCopyTreeWorkItem(
+ file_name_from, file_name_to, temp_dir_.path(), WorkItem::IF_NOT_PRESENT,
+ base::FilePath()));
EXPECT_TRUE(work_item->Do());
// verify that the source, destination have not changed and backup path
@@ -625,12 +606,10 @@ TEST_F(CopyTreeWorkItemTest, DISABLED_CopyFileInUseAndCleanup) {
// test Do().
{
- scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(file_name_from,
- file_name_to,
- temp_dir_.path(),
- WorkItem::IF_DIFFERENT,
- base::FilePath()));
+ std::unique_ptr<CopyTreeWorkItem> work_item(
+ WorkItem::CreateCopyTreeWorkItem(
+ file_name_from, file_name_to, temp_dir_.path(),
+ WorkItem::IF_DIFFERENT, base::FilePath()));
EXPECT_TRUE(work_item->Do());
@@ -693,11 +672,9 @@ TEST_F(CopyTreeWorkItemTest, DISABLED_CopyTree) {
// test Do()
{
- scoped_ptr<CopyTreeWorkItem> work_item(
- WorkItem::CreateCopyTreeWorkItem(dir_name_from,
- dir_name_to,
- temp_dir_.path(),
- WorkItem::ALWAYS,
+ std::unique_ptr<CopyTreeWorkItem> work_item(
+ WorkItem::CreateCopyTreeWorkItem(dir_name_from, dir_name_to,
+ temp_dir_.path(), WorkItem::ALWAYS,
base::FilePath()));
EXPECT_TRUE(work_item->Do());
« no previous file with comments | « chrome/installer/util/conditional_work_item_list.h ('k') | chrome/installer/util/create_dir_work_item_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698