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

Unified Diff: ui/gfx/icon_util_unittest.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr 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 | « ui/gfx/icon_util.cc ('k') | ui/gfx/image/image.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/icon_util_unittest.cc
diff --git a/ui/gfx/icon_util_unittest.cc b/ui/gfx/icon_util_unittest.cc
index 5ce5aa3055e28c3a8ed30548a03005948278fad1..7995427aadbb6f28bddc803de49b30f411a3be8b 100644
--- a/ui/gfx/icon_util_unittest.cc
+++ b/ui/gfx/icon_util_unittest.cc
@@ -6,11 +6,11 @@
#include <stddef.h>
+#include <memory>
#include <vector>
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
-#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -161,7 +161,7 @@ TEST_F(IconUtilTest, TestIconToBitmapInvalidParameters) {
static_cast<SkBitmap*>(NULL));
// The following code should succeed.
- scoped_ptr<SkBitmap> bitmap;
+ std::unique_ptr<SkBitmap> bitmap;
bitmap.reset(IconUtil::CreateSkBitmapFromHICON(icon.get(), icon_size));
EXPECT_NE(bitmap.get(), static_cast<SkBitmap*>(NULL));
}
@@ -170,7 +170,7 @@ TEST_F(IconUtilTest, TestIconToBitmapInvalidParameters) {
// gracefully when called with invalid input parameters.
TEST_F(IconUtilTest, TestBitmapToIconInvalidParameters) {
ScopedHICON icon;
- scoped_ptr<SkBitmap> bitmap;
+ std::unique_ptr<SkBitmap> bitmap;
// Wrong bitmap format.
bitmap.reset(new SkBitmap);
@@ -198,7 +198,7 @@ TEST_F(IconUtilTest, TestBitmapToIconInvalidParameters) {
// The following test case makes sure IconUtil::CreateIconFileFromImageFamily
// fails gracefully when called with invalid input parameters.
TEST_F(IconUtilTest, TestCreateIconFileInvalidParameters) {
- scoped_ptr<SkBitmap> bitmap;
+ std::unique_ptr<SkBitmap> bitmap;
gfx::ImageFamily image_family;
base::FilePath valid_icon_filename = temp_directory_.path().AppendASCII(
kTempIconFilename);
@@ -271,7 +271,7 @@ TEST_F(IconUtilTest, TestCreateIconFileEmptyImageFamily) {
// This test case makes sure that when we load an icon from disk and convert
// the HICON into a bitmap, the bitmap has the expected format and dimensions.
TEST_F(IconUtilTest, TestCreateSkBitmapFromHICON) {
- scoped_ptr<SkBitmap> bitmap;
+ std::unique_ptr<SkBitmap> bitmap;
base::FilePath small_icon_filename = test_data_directory_.AppendASCII(
kSmallIconName);
gfx::Size small_icon_size(kSmallIconWidth, kSmallIconHeight);
@@ -405,7 +405,7 @@ TEST_F(IconUtilTest, TestCreateIconFileFromImageFamily) {
TEST_F(IconUtilTest, TestCreateImageFamilyFromIconResource) {
HMODULE module = GetModuleHandle(NULL);
- scoped_ptr<gfx::ImageFamily> family(
+ std::unique_ptr<gfx::ImageFamily> family(
IconUtil::CreateImageFamilyFromIconResource(module, IDR_MAINFRAME));
ASSERT_TRUE(family.get());
EXPECT_FALSE(family->empty());
« no previous file with comments | « ui/gfx/icon_util.cc ('k') | ui/gfx/image/image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698