#include "ui/aura/client/visibility_client.h"
#include "ui/aura/client/window_tree_client.h"
#include "ui/aura/test/aura_test_base.h"
+#include "ui/aura/test/aura_test_utils.h"
#include "ui/aura/test/event_generator.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/test/test_windows.h"
transform.Translate(100.0, 100.0);
transform.Rotate(90.0);
transform.Scale(2.0, 5.0);
- host()->SetTransform(transform);
+ host()->SetRootTransform(transform);
host()->MoveCursorTo(gfx::Point(10, 10));
#if !defined(OS_WIN)
- gfx::Point mouse_location;
- EXPECT_TRUE(host()->QueryMouseLocation(&mouse_location));
// TODO(yoshiki): fix this to build on Windows. See crbug.com/133413.OD
- EXPECT_EQ("50,120", mouse_location.ToString());
+ EXPECT_EQ("50,120", QueryLatestMousePositionRequestInHost(host()).ToString());
#endif
EXPECT_EQ("10,10", gfx::Screen::GetScreenFor(
root_window())->GetCursorScreenPoint().ToString());
transform.Translate(10.0, 20.0);
transform.Rotate(10.0);
transform.Scale(0.3f, 0.5f);
- host()->SetTransform(root_transform);
+ host()->SetRootTransform(root_transform);
w1->SetTransform(transform);
w11->SetTransform(transform);
w111->SetTransform(transform);
#if !defined(OS_WIN)
// TODO(yoshiki): fix this to build on Windows. See crbug.com/133413.
- gfx::Point mouse_location;
- EXPECT_TRUE(host()->QueryMouseLocation(&mouse_location));
- EXPECT_EQ("169,80", mouse_location.ToString());
+ EXPECT_EQ("169,80", QueryLatestMousePositionRequestInHost(host()).ToString());
#endif
EXPECT_EQ("20,53",
gfx::Screen::GetScreenFor(root)->GetCursorScreenPoint().ToString());
gfx::Transform transform;
transform.Translate(size.height(), 0);
transform.Rotate(90.0);
- host()->SetTransform(transform);
+ host()->SetRootTransform(transform);
// The size should be the transformed size.
gfx::Size transformed_size(size.height(), size.width());
gfx::Transform transform;
transform.Translate(size.height(), 0.0);
transform.Rotate(90.0);
- host()->SetTransform(transform);
+ host()->SetRootTransform(transform);
ui::TouchEvent press(
ui::ET_TOUCH_PRESSED, gfx::Point(size.height() - 10, 10), 0, getTime());
scoped_ptr<Window> w(
CreateTestWindow(SK_ColorWHITE, 1, gfx::Rect(0, 0, 100, 100),
root_window()));
- scoped_ptr<ui::Layer>acquired_layer(w->AcquireLayer());
- scoped_ptr<ui::Layer>doubly_acquired_layer(w->RecreateLayer());
+ scoped_ptr<ui::Layer> acquired_layer(w->AcquireLayer());
+ scoped_ptr<ui::Layer> doubly_acquired_layer(w->RecreateLayer());
EXPECT_EQ(NULL, doubly_acquired_layer.get());
// Destroy window before layer gets destroyed.
ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION);
ui::ScopedLayerAnimationSettings settings1(child.layer()->GetAnimator());
settings1.SetTransitionDuration(base::TimeDelta::FromMilliseconds(100));
- child.SetBounds(gfx::Rect(35, 35, 100, 100));
+ gfx::Rect new_bounds(gfx::Rect(35, 35, 50, 50));
+ child.SetBounds(new_bounds);
BoundsChangedWindowObserver observer;
child.AddObserver(&observer);
parent2.AddChild(&child);
EXPECT_TRUE(observer.root_set());
- // TODO(varkha): Check that the target bounds didn't change after reparenting.
+ // Animations should stop and the bounds should be as set before the |child|
+ // got reparented.
+ EXPECT_EQ(new_bounds.ToString(), child.GetTargetBounds().ToString());
+ EXPECT_EQ(new_bounds.ToString(), child.bounds().ToString());
+ EXPECT_EQ("55,55 50x50", child.GetBoundsInRootWindow().ToString());
}
TEST_F(WindowTest, OwnedByParentFalse) {