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

Unified Diff: chrome/browser/chromeos/display/display_preferences_unittest.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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/browser/chromeos/display/display_preferences_unittest.cc
diff --git a/chrome/browser/chromeos/display/display_preferences_unittest.cc b/chrome/browser/chromeos/display/display_preferences_unittest.cc
index 13effc66a43c3177a1491d128b2035fe2bef9407..60b22f6bc901a585871cbec9057c46bd8c010470 100644
--- a/chrome/browser/chromeos/display/display_preferences_unittest.cc
+++ b/chrome/browser/chromeos/display/display_preferences_unittest.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/chromeos/display/display_preferences.h"
#include <stdint.h>
+
#include <string>
#include <utility>
#include <vector>
@@ -22,6 +23,7 @@
#include "ash/test/display_manager_test_api.h"
#include "ash/wm/maximize_mode/maximize_mode_controller.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
@@ -115,7 +117,7 @@ class DisplayPreferencesTest : public ash::test::AshTestBase {
DCHECK(!name.empty());
base::DictionaryValue* pref_data = update.Get();
- scoped_ptr<base::Value>layout_value(new base::DictionaryValue());
+ std::unique_ptr<base::Value> layout_value(new base::DictionaryValue());
if (pref_data->HasKey(name)) {
base::Value* value = nullptr;
if (pref_data->Get(name, &value) && value != nullptr)
@@ -127,7 +129,7 @@ class DisplayPreferencesTest : public ash::test::AshTestBase {
void StoreDisplayPropertyForList(const display::DisplayIdList& list,
std::string key,
- scoped_ptr<base::Value> value) {
+ std::unique_ptr<base::Value> value) {
std::string name = ash::DisplayIdListToString(list);
DictionaryPrefUpdate update(&local_state_, prefs::kSecondaryDisplays);
@@ -140,7 +142,7 @@ class DisplayPreferencesTest : public ash::test::AshTestBase {
static_cast<base::DictionaryValue*>(layout_value)
->Set(key, std::move(value));
} else {
- scoped_ptr<base::DictionaryValue> layout_value(
+ std::unique_ptr<base::DictionaryValue> layout_value(
new base::DictionaryValue());
layout_value->SetBoolean(key, value != nullptr);
pref_data->Set(name, layout_value.release());
@@ -151,7 +153,7 @@ class DisplayPreferencesTest : public ash::test::AshTestBase {
const std::string& key,
bool value) {
StoreDisplayPropertyForList(
- list, key, make_scoped_ptr(new base::FundamentalValue(value)));
+ list, key, base::WrapUnique(new base::FundamentalValue(value)));
}
void StoreDisplayLayoutPrefForList(const display::DisplayIdList& list,
@@ -207,7 +209,7 @@ class DisplayPreferencesTest : public ash::test::AshTestBase {
MockUserManager* mock_user_manager_; // Not owned.
ScopedUserManagerEnabler user_manager_enabler_;
TestingPrefServiceSimple local_state_;
- scoped_ptr<DisplayConfigurationObserver> observer_;
+ std::unique_ptr<DisplayConfigurationObserver> observer_;
DISALLOW_COPY_AND_ASSIGN(DisplayPreferencesTest);
};
@@ -287,7 +289,8 @@ TEST_F(DisplayPreferencesTest, BasicStores) {
display::DisplayLayoutBuilder dummy_layout_builder(id1);
dummy_layout_builder.SetSecondaryPlacement(
dummy_id, display::DisplayPlacement::LEFT, 20);
- scoped_ptr<display::DisplayLayout> dummy_layout(dummy_layout_builder.Build());
+ std::unique_ptr<display::DisplayLayout> dummy_layout(
+ dummy_layout_builder.Build());
display::DisplayIdList list = ash::test::CreateDisplayIdList2(id1, dummy_id);
StoreDisplayLayoutPrefForTest(list, *dummy_layout);
@@ -1022,7 +1025,7 @@ TEST_F(DisplayPreferencesTest, RestoreUnifiedMode) {
StoreDisplayBoolPropertyForList(list, "default_unified", true);
StoreDisplayPropertyForList(
list, "primary-id",
- make_scoped_ptr(new base::StringValue(base::Int64ToString(id1))));
+ base::WrapUnique(new base::StringValue(base::Int64ToString(id1))));
LoadDisplayPreferences(false);
// Should not restore to unified unless unified desktop is enabled.
« no previous file with comments | « chrome/browser/chromeos/display/display_preferences.cc ('k') | chrome/browser/chromeos/display/overscan_calibrator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698