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

Unified Diff: ui/aura/window_targeter_unittest.cc

Issue 173443002: aura: Take transformation into account when computing window bounds in root-window/screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 10 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: ui/aura/window_targeter_unittest.cc
diff --git a/ui/aura/window_targeter_unittest.cc b/ui/aura/window_targeter_unittest.cc
index 985426bb608a582657993199e609e437b52ec5d7..4e0bfb34e28f92ce4eba5d3add3d94b46d884a26 100644
--- a/ui/aura/window_targeter_unittest.cc
+++ b/ui/aura/window_targeter_unittest.cc
@@ -40,18 +40,6 @@ class WindowTargeterTest : public test::AuraTestBase {
Window* root_window() { return AuraTestBase::root_window(); }
};
-gfx::RectF GetEffectiveVisibleBoundsInRootWindow(Window* window) {
- gfx::RectF bounds = gfx::Rect(window->bounds().size());
- Window* root = window->GetRootWindow();
- CHECK(window->layer());
- CHECK(root->layer());
- gfx::Transform transform;
- if (!window->layer()->GetTargetTransformRelativeTo(root->layer(), &transform))
- return gfx::RectF();
- transform.TransformRect(&bounds);
- return bounds;
-}
-
TEST_F(WindowTargeterTest, Basic) {
test::TestWindowDelegate delegate;
scoped_ptr<Window> window(CreateNormalWindow(1, root_window(), &delegate));
@@ -141,8 +129,8 @@ TEST_F(WindowTargeterTest, TargetTransformedWindow) {
gfx::Transform transform;
transform.Scale(0.5, 0.5);
window->SetTransform(transform);
- EXPECT_EQ(gfx::RectF(100, 20, 200, 40).ToString(),
- GetEffectiveVisibleBoundsInRootWindow(window.get()).ToString());
+ EXPECT_EQ(gfx::Rect(100, 20, 200, 40).ToString(),
+ window->GetBoundsInRootWindow().ToString());
{
ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, event_location, event_location,
ui::EF_NONE, ui::EF_NONE);
@@ -153,8 +141,8 @@ TEST_F(WindowTargeterTest, TargetTransformedWindow) {
transform.Translate(200, 10);
transform.Scale(0.5, 0.5);
window->SetTransform(transform);
- EXPECT_EQ(gfx::RectF(300, 30, 200, 40).ToString(),
- GetEffectiveVisibleBoundsInRootWindow(window.get()).ToString());
+ EXPECT_EQ(gfx::Rect(300, 30, 200, 40).ToString(),
+ window->GetBoundsInRootWindow().ToString());
{
ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, event_location, event_location,
ui::EF_NONE, ui::EF_NONE);
« ui/aura/window.cc ('K') | « ui/aura/window.cc ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698