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

Unified Diff: ash/wm/overview/window_selector_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: ash/wm/overview/window_selector_unittest.cc
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc
index c23fedc189d4d293b3ed92475c59743b5e19f62a..8d2bcb4977512510e043eb82cf421064cd5efec1 100644
--- a/ash/wm/overview/window_selector_unittest.cc
+++ b/ash/wm/overview/window_selector_unittest.cc
@@ -198,20 +198,6 @@ class WindowSelectorTest : public test::AshTestBase {
return bounds;
}
- gfx::RectF GetTransformedBoundsInRootWindow(aura::Window* window) {
- gfx::RectF bounds = gfx::Rect(window->bounds().size());
- aura::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;
- }
-
void ClickWindow(aura::Window* window) {
aura::test::EventGenerator event_generator(window->GetRootWindow(), window);
gfx::RectF target = GetTransformedBounds(window);
@@ -1051,15 +1037,15 @@ TEST_F(WindowSelectorTest, HitTestingInOverview) {
scoped_ptr<aura::Window> window2(CreateWindow(window_bounds));
ToggleOverview();
- gfx::RectF bounds1 = GetTransformedBoundsInRootWindow(window1.get());
- gfx::RectF bounds2 = GetTransformedBoundsInRootWindow(window2.get());
+ gfx::Rect bounds1 = window1->GetBoundsInRootWindow();
+ gfx::Rect bounds2 = window2->GetBoundsInRootWindow();
EXPECT_NE(bounds1.ToString(), bounds2.ToString());
ui::EventTarget* root_target = root_window;
ui::EventTargeter* targeter = root_target->GetEventTargeter();
aura::Window* windows[] = { window1.get(), window2.get() };
for (size_t w = 0; w < arraysize(windows); ++w) {
- gfx::RectF bounds = GetTransformedBoundsInRootWindow(windows[w]);
+ gfx::Rect bounds = windows[w]->GetBoundsInRootWindow();
gfx::Point points[] = {
gfx::Point(bounds.x(), bounds.y()),
gfx::Point(bounds.right() - 1, bounds.y()),

Powered by Google App Engine
This is Rietveld 408576698