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

Side by Side Diff: ash/wm/overview/window_selector_unittest.cc

Issue 2681613002: Avoid two targeting phases in aura client-lib and EventProcessor. (Closed)
Patch Set: test Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "ash/common/accessibility_delegate.h" 8 #include "ash/common/accessibility_delegate.h"
9 #include "ash/common/accessibility_types.h" 9 #include "ash/common/accessibility_types.h"
10 #include "ash/common/ash_switches.h" 10 #include "ash/common/ash_switches.h"
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 gfx::Rect window_bounds(20, 10, 200, 300); 1019 gfx::Rect window_bounds(20, 10, 200, 300);
1020 aura::Window* root_window = Shell::GetPrimaryRootWindow(); 1020 aura::Window* root_window = Shell::GetPrimaryRootWindow();
1021 std::unique_ptr<aura::Window> window(CreateWindow(window_bounds)); 1021 std::unique_ptr<aura::Window> window(CreateWindow(window_bounds));
1022 1022
1023 gfx::Point point1(window_bounds.x() + 10, window_bounds.y() + 10); 1023 gfx::Point point1(window_bounds.x() + 10, window_bounds.y() + 10);
1024 1024
1025 ui::MouseEvent event1(ui::ET_MOUSE_PRESSED, point1, point1, 1025 ui::MouseEvent event1(ui::ET_MOUSE_PRESSED, point1, point1,
1026 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); 1026 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
1027 1027
1028 ui::EventTarget* root_target = root_window; 1028 ui::EventTarget* root_target = root_window;
1029 ui::EventTargeter* targeter = root_target->GetEventTargeter(); 1029 ui::EventTargeter* targeter =
1030 root_window->GetHost()->dispatcher()->GetDefaultEventTargeter();
1030 1031
1031 // The event should target the window because we are still not in overview 1032 // The event should target the window because we are still not in overview
1032 // mode. 1033 // mode.
1033 EXPECT_EQ(window.get(), targeter->FindTargetForEvent(root_target, &event1)); 1034 EXPECT_EQ(window.get(), targeter->FindTargetForEvent(root_target, &event1));
1034 1035
1035 ToggleOverview(); 1036 ToggleOverview();
1036 1037
1037 // The bounds have changed, take that into account. 1038 // The bounds have changed, take that into account.
1038 gfx::Rect bounds = GetTransformedBoundsInRootWindow(window.get()); 1039 gfx::Rect bounds = GetTransformedBoundsInRootWindow(window.get());
1039 gfx::Point point2(bounds.x() + 10, bounds.y() + 10); 1040 gfx::Point point2(bounds.x() + 10, bounds.y() + 10);
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
2126 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); 2127 aura::client::WINDOW_MOVE_SOURCE_MOUSE));
2127 ASSERT_TRUE(resizer.get()); 2128 ASSERT_TRUE(resizer.get());
2128 gfx::Point location = resizer->GetInitialLocation(); 2129 gfx::Point location = resizer->GetInitialLocation();
2129 location.Offset(20, 20); 2130 location.Offset(20, 20);
2130 resizer->Drag(location, 0); 2131 resizer->Drag(location, 0);
2131 ToggleOverview(); 2132 ToggleOverview();
2132 resizer->RevertDrag(); 2133 resizer->RevertDrag();
2133 } 2134 }
2134 2135
2135 } // namespace ash 2136 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698