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

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

Issue 106673003: Update the selected resolution to the resolution that is actually selected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update test Created 6 years, 11 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/display/display_manager_unittest.cc ('k') | no next file » | 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 e088828dc351262ac77d0ab3ee0d6b928e1cbc0b..1fd4b5cc54d1d025389b42e8768a1b5cf8551749 100644
--- a/chrome/browser/chromeos/display/display_preferences_unittest.cc
+++ b/chrome/browser/chromeos/display/display_preferences_unittest.cc
@@ -34,9 +34,9 @@ const char kOffsetKey[] = "offset";
class DisplayPreferencesTest : public ash::test::AshTestBase {
protected:
- DisplayPreferencesTest() : ash::test::AshTestBase(),
- mock_user_manager_(new MockUserManager),
- user_manager_enabler_(mock_user_manager_) {
+ DisplayPreferencesTest()
+ : mock_user_manager_(new MockUserManager),
+ user_manager_enabler_(mock_user_manager_) {
}
virtual ~DisplayPreferencesTest() {}
@@ -351,6 +351,34 @@ TEST_F(DisplayPreferencesTest, BasicStores) {
EXPECT_TRUE(layout_value->GetString(kPrimaryIdKey, &primary_id_str));
EXPECT_EQ(base::Int64ToString(id1), primary_id_str);
+ // Best resolution should not be saved.
+ EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id2), &property));
+ EXPECT_FALSE(property->GetInteger("width", &width));
+ 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));
+ // Disconnect 2nd display first to generate new id for external display.
+ UpdateDisplay("200x200*2");
+ UpdateDisplay("200x200*2, 500x400#600x500|500x400");
+ // Update key as the 2nd display gets new id.
+ id2 = ash::ScreenAsh::GetSecondaryDisplay().id();
+ key = base::Int64ToString(id1) + "," + base::Int64ToString(id2);
+ EXPECT_TRUE(displays->GetDictionary(key, &layout_value));
+ EXPECT_TRUE(layout_value->GetString(kPositionKey, &position));
+ EXPECT_EQ("right", position);
+ EXPECT_TRUE(layout_value->GetInteger(kOffsetKey, &offset));
+ EXPECT_EQ(0, offset);
+ mirrored = true;
+ EXPECT_TRUE(layout_value->GetBoolean(kMirroredKey, &mirrored));
+ EXPECT_FALSE(mirrored);
+ 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.
EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id2), &property));
EXPECT_TRUE(property->GetInteger("width", &width));
« no previous file with comments | « ash/display/display_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698