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

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

Issue 1819533002: Convert ScopedVector<DisplayPlacement> to std::vector<DisplayPlacement> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@jsonrefactor
Patch Set: Created 4 years, 9 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 | « ash/extended_desktop_unittest.cc ('k') | chrome/browser/extensions/display_info_provider_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3aa58624076ed7ca9ca12d784e3ac45d072437fd..18f0d2ab6ba292c73bb70e8c3baca0f3c16f2989 100644
--- a/chrome/browser/chromeos/display/display_preferences_unittest.cc
+++ b/chrome/browser/chromeos/display/display_preferences_unittest.cc
@@ -108,8 +108,7 @@ class DisplayPreferencesTest : public ash::test::AshTestBase {
std::string name = ash::DisplayIdListToString(list);
DictionaryPrefUpdate update(&local_state_, prefs::kSecondaryDisplays);
ash::DisplayLayout display_layout;
- display_layout.placement_list.push_back(
- new ash::DisplayPlacement(position, offset));
+ display_layout.placement_list.emplace_back(position, offset);
display_layout.primary_id = primary_id;
DCHECK(!name.empty());
@@ -197,7 +196,7 @@ class DisplayPreferencesTest : public ash::test::AshTestBase {
->layout_store()
->GetRegisteredDisplayLayout(list)
.placement_list[0]
- ->ToString();
+ .ToString();
}
PrefService* local_state() { return &local_state_; }
@@ -244,7 +243,7 @@ TEST_F(DisplayPreferencesTest, ListedLayoutOverrides) {
shell->display_manager()
->GetCurrentDisplayLayout()
.placement_list[0]
- ->ToString());
+ .ToString());
EXPECT_EQ("id=2200000001, parent=2200000000, top, 20",
GetRegisteredDisplayPlacementStr(list));
EXPECT_EQ("id=2200000002, parent=2200000000, left, 30",
@@ -278,8 +277,8 @@ TEST_F(DisplayPreferencesTest, BasicStores) {
display_manager->SetLayoutForCurrentDisplays(
ash::test::CreateDisplayLayout(ash::DisplayPlacement::TOP, 10));
const ash::DisplayLayout& layout = display_manager->GetCurrentDisplayLayout();
- EXPECT_EQ(ash::DisplayPlacement::TOP, layout.placement_list[0]->position);
- EXPECT_EQ(10, layout.placement_list[0]->offset);
+ EXPECT_EQ(ash::DisplayPlacement::TOP, layout.placement_list[0].position);
+ EXPECT_EQ(10, layout.placement_list[0].offset);
ash::DisplayLayoutBuilder dummy_layout_builder(id1);
dummy_layout_builder.SetSecondaryPlacement(dummy_id,
@@ -310,10 +309,10 @@ TEST_F(DisplayPreferencesTest, BasicStores) {
EXPECT_TRUE(ash::JsonToDisplayLayout(*layout_value, &stored_layout));
ASSERT_EQ(1u, stored_layout.placement_list.size());
- EXPECT_EQ(dummy_layout->placement_list[0]->position,
- stored_layout.placement_list[0]->position);
- EXPECT_EQ(dummy_layout->placement_list[0]->offset,
- stored_layout.placement_list[0]->offset);
+ EXPECT_EQ(dummy_layout->placement_list[0].position,
+ stored_layout.placement_list[0].position);
+ EXPECT_EQ(dummy_layout->placement_list[0].offset,
+ stored_layout.placement_list[0].offset);
bool mirrored = true;
EXPECT_TRUE(layout_value->GetBoolean(kMirroredKey, &mirrored));
@@ -404,7 +403,7 @@ TEST_F(DisplayPreferencesTest, BasicStores) {
EXPECT_TRUE(ash::JsonToDisplayLayout(*layout_value, &stored_layout));
ASSERT_EQ(1u, stored_layout.placement_list.size());
const ash::DisplayPlacement& stored_placement =
- *stored_layout.placement_list[0];
+ stored_layout.placement_list[0];
EXPECT_EQ(ash::DisplayPlacement::BOTTOM, stored_placement.position);
EXPECT_EQ(-10, stored_placement.offset);
EXPECT_EQ(id1, stored_placement.display_id);
@@ -581,7 +580,7 @@ TEST_F(DisplayPreferencesTest, StoreForSwappedDisplay) {
EXPECT_TRUE(ash::JsonToDisplayLayout(*new_value, &stored_layout));
ASSERT_EQ(1u, stored_layout.placement_list.size());
const ash::DisplayPlacement& stored_placement =
- *stored_layout.placement_list[0];
+ stored_layout.placement_list[0];
EXPECT_EQ(ash::DisplayPlacement::LEFT, stored_placement.position);
EXPECT_EQ(0, stored_placement.offset);
EXPECT_EQ(id1, stored_placement.display_id);
@@ -599,7 +598,7 @@ TEST_F(DisplayPreferencesTest, StoreForSwappedDisplay) {
EXPECT_TRUE(ash::JsonToDisplayLayout(*new_value, &stored_layout));
ASSERT_EQ(1u, stored_layout.placement_list.size());
const ash::DisplayPlacement& stored_placement =
- *stored_layout.placement_list[0];
+ stored_layout.placement_list[0];
EXPECT_EQ(ash::DisplayPlacement::TOP, stored_placement.position);
EXPECT_EQ(10, stored_placement.offset);
EXPECT_EQ(id1, stored_placement.display_id);
@@ -618,7 +617,7 @@ TEST_F(DisplayPreferencesTest, StoreForSwappedDisplay) {
EXPECT_TRUE(ash::JsonToDisplayLayout(*new_value, &stored_layout));
ASSERT_EQ(1u, stored_layout.placement_list.size());
const ash::DisplayPlacement& stored_placement =
- *stored_layout.placement_list[0];
+ stored_layout.placement_list[0];
EXPECT_EQ(ash::DisplayPlacement::BOTTOM, stored_placement.position);
EXPECT_EQ(-10, stored_placement.offset);
EXPECT_EQ(id2, stored_placement.display_id);
@@ -688,7 +687,7 @@ TEST_F(DisplayPreferencesTest, DontStoreInGuestMode) {
gfx::Screen* screen = gfx::Screen::GetScreen();
EXPECT_EQ(id2, screen->GetPrimaryDisplay().id());
const ash::DisplayPlacement& placement =
- *display_manager->GetCurrentDisplayLayout().placement_list[0];
+ display_manager->GetCurrentDisplayLayout().placement_list[0];
EXPECT_EQ(ash::DisplayPlacement::BOTTOM, placement.position);
EXPECT_EQ(-10, placement.offset);
const gfx::Display& primary_display = screen->GetPrimaryDisplay();
« no previous file with comments | « ash/extended_desktop_unittest.cc ('k') | chrome/browser/extensions/display_info_provider_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698