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

Side by Side Diff: chrome/browser/extensions/display_info_provider_chromeos_unittest.cc

Issue 1108343002: Revert of Merge Prevent DisplayPreferences from saving incorrect rotations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2357
Patch Set: Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/api/system_display/display_info_provider.h" 5 #include "extensions/browser/api/system_display/display_info_provider.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/screen_util.h" 9 #include "ash/screen_util.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 ASSERT_EQ(1u, result.size()); 114 ASSERT_EQ(1u, result.size());
115 115
116 int64 display_id; 116 int64 display_id;
117 ASSERT_TRUE(base::StringToInt64(result[0]->id, &display_id)) 117 ASSERT_TRUE(base::StringToInt64(result[0]->id, &display_id))
118 << "Display id must be convertable to integer: " << result[0]->id; 118 << "Display id must be convertable to integer: " << result[0]->id;
119 119
120 ASSERT_TRUE(DisplayExists(display_id)) << display_id << " not found"; 120 ASSERT_TRUE(DisplayExists(display_id)) << display_id << " not found";
121 EXPECT_EQ("0,0 600x500", SystemInfoDisplayBoundsToString(result[0]->bounds)); 121 EXPECT_EQ("0,0 600x500", SystemInfoDisplayBoundsToString(result[0]->bounds));
122 EXPECT_EQ(90, result[0]->rotation); 122 EXPECT_EQ(90, result[0]->rotation);
123 123
124 GetDisplayManager()->SetDisplayRotation(display_id, gfx::Display::ROTATE_270, 124 GetDisplayManager()->SetDisplayRotation(display_id, gfx::Display::ROTATE_270);
125 gfx::Display::ROTATION_SOURCE_ACTIVE);
126 125
127 result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); 126 result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
128 127
129 ASSERT_EQ(1u, result.size()); 128 ASSERT_EQ(1u, result.size());
130 129
131 EXPECT_EQ(base::Int64ToString(display_id), result[0]->id); 130 EXPECT_EQ(base::Int64ToString(display_id), result[0]->id);
132 EXPECT_EQ("0,0 600x500", SystemInfoDisplayBoundsToString(result[0]->bounds)); 131 EXPECT_EQ("0,0 600x500", SystemInfoDisplayBoundsToString(result[0]->bounds));
133 EXPECT_EQ(270, result[0]->rotation); 132 EXPECT_EQ(270, result[0]->rotation);
134 133
135 GetDisplayManager()->SetDisplayRotation(display_id, gfx::Display::ROTATE_180, 134 GetDisplayManager()->SetDisplayRotation(display_id, gfx::Display::ROTATE_180);
136 gfx::Display::ROTATION_SOURCE_ACTIVE);
137 135
138 result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); 136 result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
139 137
140 ASSERT_EQ(1u, result.size()); 138 ASSERT_EQ(1u, result.size());
141 139
142 EXPECT_EQ(base::Int64ToString(display_id), result[0]->id); 140 EXPECT_EQ(base::Int64ToString(display_id), result[0]->id);
143 EXPECT_EQ("0,0 500x600", SystemInfoDisplayBoundsToString(result[0]->bounds)); 141 EXPECT_EQ("0,0 500x600", SystemInfoDisplayBoundsToString(result[0]->bounds));
144 EXPECT_EQ(180, result[0]->rotation); 142 EXPECT_EQ(180, result[0]->rotation);
145 143
146 GetDisplayManager()->SetDisplayRotation(display_id, gfx::Display::ROTATE_0, 144 GetDisplayManager()->SetDisplayRotation(display_id, gfx::Display::ROTATE_0);
147 gfx::Display::ROTATION_SOURCE_ACTIVE);
148 145
149 result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); 146 result = DisplayInfoProvider::Get()->GetAllDisplaysInfo();
150 147
151 ASSERT_EQ(1u, result.size()); 148 ASSERT_EQ(1u, result.size());
152 149
153 EXPECT_EQ(base::Int64ToString(display_id), result[0]->id); 150 EXPECT_EQ(base::Int64ToString(display_id), result[0]->id);
154 EXPECT_EQ("0,0 500x600", SystemInfoDisplayBoundsToString(result[0]->bounds)); 151 EXPECT_EQ("0,0 500x600", SystemInfoDisplayBoundsToString(result[0]->bounds));
155 EXPECT_EQ(0, result[0]->rotation); 152 EXPECT_EQ(0, result[0]->rotation);
156 } 153 }
157 154
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 std::string error; 882 std::string error;
886 CallSetDisplayUnitInfo( 883 CallSetDisplayUnitInfo(
887 base::Int64ToString(internal_display_id), info, &success, &error); 884 base::Int64ToString(internal_display_id), info, &success, &error);
888 885
889 ASSERT_FALSE(success); 886 ASSERT_FALSE(success);
890 EXPECT_EQ("Overscan changes not allowed for the internal monitor.", error); 887 EXPECT_EQ("Overscan changes not allowed for the internal monitor.", error);
891 } 888 }
892 889
893 } // namespace 890 } // namespace
894 } // namespace extensions 891 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698