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

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: early return Created 3 years, 9 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 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 gfx::Rect window_bounds(20, 10, 200, 300); 1021 gfx::Rect window_bounds(20, 10, 200, 300);
1022 aura::Window* root_window = Shell::GetPrimaryRootWindow(); 1022 aura::Window* root_window = Shell::GetPrimaryRootWindow();
1023 std::unique_ptr<aura::Window> window(CreateWindow(window_bounds)); 1023 std::unique_ptr<aura::Window> window(CreateWindow(window_bounds));
1024 1024
1025 gfx::Point point1(window_bounds.x() + 10, window_bounds.y() + 10); 1025 gfx::Point point1(window_bounds.x() + 10, window_bounds.y() + 10);
1026 1026
1027 ui::MouseEvent event1(ui::ET_MOUSE_PRESSED, point1, point1, 1027 ui::MouseEvent event1(ui::ET_MOUSE_PRESSED, point1, point1,
1028 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); 1028 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
1029 1029
1030 ui::EventTarget* root_target = root_window; 1030 ui::EventTarget* root_target = root_window;
1031 ui::EventTargeter* targeter = root_target->GetEventTargeter(); 1031 ui::EventTargeter* targeter =
1032 root_window->GetHost()->dispatcher()->GetDefaultEventTargeter();
1032 1033
1033 // The event should target the window because we are still not in overview 1034 // The event should target the window because we are still not in overview
1034 // mode. 1035 // mode.
1035 EXPECT_EQ(window.get(), targeter->FindTargetForEvent(root_target, &event1)); 1036 EXPECT_EQ(window.get(), targeter->FindTargetForEvent(root_target, &event1));
1036 1037
1037 ToggleOverview(); 1038 ToggleOverview();
1038 1039
1039 // The bounds have changed, take that into account. 1040 // The bounds have changed, take that into account.
1040 gfx::Rect bounds = GetTransformedBoundsInRootWindow(window.get()); 1041 gfx::Rect bounds = GetTransformedBoundsInRootWindow(window.get());
1041 gfx::Point point2(bounds.x() + 10, bounds.y() + 10); 1042 gfx::Point point2(bounds.x() + 10, bounds.y() + 10);
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
2128 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); 2129 aura::client::WINDOW_MOVE_SOURCE_MOUSE));
2129 ASSERT_TRUE(resizer.get()); 2130 ASSERT_TRUE(resizer.get());
2130 gfx::Point location = resizer->GetInitialLocation(); 2131 gfx::Point location = resizer->GetInitialLocation();
2131 location.Offset(20, 20); 2132 location.Offset(20, 20);
2132 resizer->Drag(location, 0); 2133 resizer->Drag(location, 0);
2133 ToggleOverview(); 2134 ToggleOverview();
2134 resizer->RevertDrag(); 2135 resizer->RevertDrag();
2135 } 2136 }
2136 2137
2137 } // namespace ash 2138 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/immersive_fullscreen_controller_unittest.cc ('k') | ash/wm/panels/panel_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698