Chromium Code Reviews| 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 03d604e44b7faf6afee84214abeff88cf40a564e..8cde6ce5ecf7cd6467701cb364c572afc05353e3 100644 |
| --- a/chrome/browser/chromeos/display/display_preferences_unittest.cc |
| +++ b/chrome/browser/chromeos/display/display_preferences_unittest.cc |
| @@ -231,8 +231,9 @@ TEST_F(DisplayPreferencesTest, BasicStores) { |
| EXPECT_EQ(1, rotation); |
| EXPECT_EQ(1250, ui_scale); |
| - // Internal display never registere the resolution. |
| + // Internal display never registered the resolution. |
| int width = 0, height = 0; |
| + float refresh_rate = 0.0f; |
| EXPECT_FALSE(property->GetInteger("width", &width)); |
| EXPECT_FALSE(property->GetInteger("height", &height)); |
| @@ -271,11 +272,11 @@ TEST_F(DisplayPreferencesTest, BasicStores) { |
| EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id1), &property)); |
| width = 0; |
| height = 0; |
| - // Internal dispaly shouldn't store its resolution. |
| + // Internal display shouldn't store its resolution. |
| EXPECT_FALSE(property->GetInteger("width", &width)); |
| EXPECT_FALSE(property->GetInteger("height", &height)); |
| - // External dispaly's resolution must be stored this time because |
| + // External display's resolution must be stored this time because |
| // it's not best. |
| EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id2), &property)); |
| EXPECT_TRUE(property->GetInteger("width", &width)); |
| @@ -320,7 +321,7 @@ TEST_F(DisplayPreferencesTest, BasicStores) { |
| EXPECT_FALSE(property->GetInteger("width", &width)); |
| EXPECT_FALSE(property->GetInteger("height", &height)); |
| - // External dispaly's selected resolution must not change |
| + // External display's selected resolution must not change |
| // by mirroring. |
| EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id2), &property)); |
| EXPECT_TRUE(property->GetInteger("width", &width)); |
| @@ -329,11 +330,8 @@ TEST_F(DisplayPreferencesTest, BasicStores) { |
| EXPECT_EQ(200, height); |
| // Set new display's selected resolution. |
| - display_manager->RegisterDisplayProperty(id2 + 1, |
| - gfx::Display::ROTATE_0, |
| - 1.0f, |
| - NULL, |
| - gfx::Size(500, 400)); |
| + display_manager->RegisterDisplayProperty( |
| + id2 + 1, gfx::Display::ROTATE_0, 1.0f, NULL, gfx::Size(500, 400)); |
| UpdateDisplay("200x200*2, 600x500#600x500|500x400"); |
| @@ -357,14 +355,11 @@ TEST_F(DisplayPreferencesTest, BasicStores) { |
| EXPECT_FALSE(property->GetInteger("height", &height)); |
| // Set yet another new display's selected resolution. |
| - display_manager->RegisterDisplayProperty(id2 + 1, |
| - gfx::Display::ROTATE_0, |
| - 1.0f, |
| - NULL, |
| - gfx::Size(500, 400)); |
| + display_manager->RegisterDisplayProperty( |
| + id2 + 1, gfx::Display::ROTATE_0, 1.0f, NULL, gfx::Size(500, 400)); |
| // Disconnect 2nd display first to generate new id for external display. |
| UpdateDisplay("200x200*2"); |
| - UpdateDisplay("200x200*2, 500x400#600x500|500x400"); |
| + UpdateDisplay("200x200*2, 500x400#600x500|500x400%60.0f"); |
| // Update key as the 2nd display gets new id. |
| id2 = ash::ScreenUtil::GetSecondaryDisplay().id(); |
| key = base::Int64ToString(id1) + "," + base::Int64ToString(id2); |
| @@ -379,12 +374,15 @@ TEST_F(DisplayPreferencesTest, BasicStores) { |
| EXPECT_TRUE(layout_value->GetString(kPrimaryIdKey, &primary_id_str)); |
| EXPECT_EQ(base::Int64ToString(id1), primary_id_str); |
| - // External dispaly's selected resolution must be updated. |
| + // External display's selected resolution must be updated. |
| EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id2), &property)); |
| EXPECT_TRUE(property->GetInteger("width", &width)); |
| EXPECT_TRUE(property->GetInteger("height", &height)); |
| + EXPECT_TRUE(property->GetFloat("refresh-rate", &refresh_rate); |
|
oshima
2014/01/29 19:00:35
you don't need this right?
sheu
2014/01/29 22:43:36
Done.
|
| EXPECT_EQ(500, width); |
| EXPECT_EQ(400, height); |
| + // Refresh rate should use value reported by the display. |
| + EXPECT_EQ(60.0f, refresh_rate); |
| } |
| TEST_F(DisplayPreferencesTest, PreventStore) { |