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

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

Issue 2196923002: Make ash::DisplayMode more like ui::DisplayMode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more tests fixed Created 4 years, 4 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 f2fa5355765c1ad880b92f816433ffecc2874fba..b4f9e8b2065e199c4f8ea9d40b3376d89ef9c51a 100644
--- a/chrome/browser/chromeos/display/display_preferences_unittest.cc
+++ b/chrome/browser/chromeos/display/display_preferences_unittest.cc
@@ -378,8 +378,9 @@ TEST_F(DisplayPreferencesTest, BasicStores) {
EXPECT_FALSE(property->GetInteger("width", &width));
EXPECT_FALSE(property->GetInteger("height", &height));
- ash::DisplayMode mode(gfx::Size(300, 200), 60.0f, false, true);
- mode.device_scale_factor = 1.25f;
+ scoped_refptr<ash::DisplayMode> mode(new ash::DisplayMode(
+ gfx::Size(300, 200), 60.0f, false, true, /* ui_scale */ 1.0,
+ /* device_scale_factor */ 1.25f));
display_manager->SetDisplayMode(id2, mode);
window_tree_host_manager->SetPrimaryDisplayId(id2);
@@ -527,10 +528,11 @@ TEST_F(DisplayPreferencesTest, PreventStore) {
// Set display's resolution in single display. It creates the notification and
// display preferences should not stored meanwhile.
ash::Shell* shell = ash::Shell::GetInstance();
- ash::DisplayMode old_mode;
- ash::DisplayMode new_mode;
- old_mode.size = gfx::Size(400, 300);
- new_mode.size = gfx::Size(500, 400);
+
+ scoped_refptr<ash::DisplayMode> old_mode(
+ new ash::DisplayMode(gfx::Size(400, 300)));
+ scoped_refptr<ash::DisplayMode> new_mode(
+ new ash::DisplayMode(gfx::Size(500, 400)));
if (shell->display_manager()->SetDisplayMode(id, new_mode)) {
shell->resolution_notification_controller()->PrepareNotification(
id, old_mode, new_mode, base::Closure());
@@ -556,7 +558,8 @@ TEST_F(DisplayPreferencesTest, PreventStore) {
// Once the notification is removed, the specified resolution will be stored
// by SetDisplayMode.
ash::Shell::GetInstance()->display_manager()->SetDisplayMode(
- id, ash::DisplayMode(gfx::Size(300, 200), 60.0f, false, true));
+ id, make_scoped_refptr(
+ new ash::DisplayMode(gfx::Size(300, 200), 60.0f, false, true)));
UpdateDisplay("300x200#500x400|400x300|300x200");
property = nullptr;

Powered by Google App Engine
This is Rietveld 408576698