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

Side by Side Diff: ui/aura/window_unittest.cc

Issue 10540123: Rename gfx::Screen::GetMonitorXXXX to gfx::Screen::GetDisplayXXX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « ui/aura/test/test_screen.cc ('k') | ui/base/x/events_x.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 w12->set_ignore_events(true); 1158 w12->set_ignore_events(true);
1159 EXPECT_EQ(w111.get(), w1->GetEventHandlerForPoint(gfx::Point(160, 160))); 1159 EXPECT_EQ(w111.get(), w1->GetEventHandlerForPoint(gfx::Point(160, 160)));
1160 w111->set_ignore_events(true); 1160 w111->set_ignore_events(true);
1161 EXPECT_EQ(w11.get(), w1->GetEventHandlerForPoint(gfx::Point(160, 160))); 1161 EXPECT_EQ(w11.get(), w1->GetEventHandlerForPoint(gfx::Point(160, 160)));
1162 } 1162 }
1163 1163
1164 // Tests transformation on the root window. 1164 // Tests transformation on the root window.
1165 TEST_F(WindowTest, Transform) { 1165 TEST_F(WindowTest, Transform) {
1166 gfx::Size size = root_window()->GetHostSize(); 1166 gfx::Size size = root_window()->GetHostSize();
1167 EXPECT_EQ(gfx::Rect(size), 1167 EXPECT_EQ(gfx::Rect(size),
1168 gfx::Screen::GetMonitorNearestPoint(gfx::Point()).bounds()); 1168 gfx::Screen::GetDisplayNearestPoint(gfx::Point()).bounds());
1169 1169
1170 // Rotate it clock-wise 90 degrees. 1170 // Rotate it clock-wise 90 degrees.
1171 ui::Transform transform; 1171 ui::Transform transform;
1172 transform.SetRotate(90.0f); 1172 transform.SetRotate(90.0f);
1173 transform.ConcatTranslate(size.height(), 0); 1173 transform.ConcatTranslate(size.height(), 0);
1174 root_window()->SetTransform(transform); 1174 root_window()->SetTransform(transform);
1175 1175
1176 // The size should be the transformed size. 1176 // The size should be the transformed size.
1177 gfx::Size transformed_size(size.height(), size.width()); 1177 gfx::Size transformed_size(size.height(), size.width());
1178 EXPECT_EQ(transformed_size.ToString(), 1178 EXPECT_EQ(transformed_size.ToString(),
1179 root_window()->bounds().size().ToString()); 1179 root_window()->bounds().size().ToString());
1180 EXPECT_EQ( 1180 EXPECT_EQ(
1181 gfx::Rect(transformed_size).ToString(), 1181 gfx::Rect(transformed_size).ToString(),
1182 gfx::Screen::GetMonitorNearestPoint(gfx::Point()).bounds().ToString()); 1182 gfx::Screen::GetDisplayNearestPoint(gfx::Point()).bounds().ToString());
1183 1183
1184 // Host size shouldn't change. 1184 // Host size shouldn't change.
1185 EXPECT_EQ(size.ToString(), 1185 EXPECT_EQ(size.ToString(),
1186 root_window()->GetHostSize().ToString()); 1186 root_window()->GetHostSize().ToString());
1187 } 1187 }
1188 1188
1189 TEST_F(WindowTest, TransformGesture) { 1189 TEST_F(WindowTest, TransformGesture) {
1190 gfx::Size size = root_window()->GetHostSize(); 1190 gfx::Size size = root_window()->GetHostSize();
1191 1191
1192 scoped_ptr<GestureTrackPositionDelegate> delegate( 1192 scoped_ptr<GestureTrackPositionDelegate> delegate(
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2311 element->Step(start_time + base::TimeDelta::FromMilliseconds(1000)); 2311 element->Step(start_time + base::TimeDelta::FromMilliseconds(1000));
2312 2312
2313 // No bounds changed notification at the end of animation since layer 2313 // No bounds changed notification at the end of animation since layer
2314 // delegate is NULL. 2314 // delegate is NULL.
2315 EXPECT_FALSE(delegate.bounds_changed()); 2315 EXPECT_FALSE(delegate.bounds_changed());
2316 EXPECT_NE("0,0 100x100", window->bounds().ToString()); 2316 EXPECT_NE("0,0 100x100", window->bounds().ToString());
2317 } 2317 }
2318 2318
2319 } // namespace test 2319 } // namespace test
2320 } // namespace aura 2320 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/test_screen.cc ('k') | ui/base/x/events_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698