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

Unified Diff: ash/wm/window_manager_unittest.cc

Issue 10827145: Convert Aura to use ui::Event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « ash/wm/window_cycle_controller.cc ('k') | ash/wm/window_modality_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_manager_unittest.cc
===================================================================
--- ash/wm/window_manager_unittest.cc (revision 150582)
+++ ash/wm/window_manager_unittest.cc (working copy)
@@ -12,7 +12,6 @@
#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/activation_delegate.h"
#include "ui/aura/env.h"
-#include "ui/aura/event.h"
#include "ui/aura/focus_manager.h"
#include "ui/aura/root_window.h"
#include "ui/aura/shared/compound_event_filter.h"
@@ -23,6 +22,7 @@
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/test/test_windows.h"
#include "ui/base/cursor/cursor.h"
+#include "ui/base/event.h"
#include "ui/base/hit_test.h"
#include "ui/gfx/screen.h"
@@ -116,14 +116,14 @@
EXPECT_EQ(w121.get(), focus_manager->GetFocusedWindow());
// The key press should be sent to the focused sub-window.
- aura::KeyEvent keyev(ui::ET_KEY_PRESSED, ui::VKEY_E, 0);
+ ui::KeyEvent keyev(ui::ET_KEY_PRESSED, ui::VKEY_E, 0);
root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&keyev);
EXPECT_EQ(ui::VKEY_E, w121delegate->last_key_code());
// Touch on a sub-window (w122) to focus it.
gfx::Point click_point = w122->bounds().CenterPoint();
- aura::Window::ConvertPointToWindow(w122->parent(), root_window, &click_point);
- aura::TouchEvent touchev(ui::ET_TOUCH_PRESSED, click_point, 0, getTime());
+ aura::Window::ConvertPointToTarget(w122->parent(), root_window, &click_point);
+ ui::TouchEventImpl touchev(ui::ET_TOUCH_PRESSED, click_point, 0, getTime());
root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev);
focus_manager = w122->GetFocusManager();
EXPECT_EQ(w122.get(), focus_manager->GetFocusedWindow());
@@ -263,7 +263,7 @@
// Then click the parent active window. The focus shouldn't move.
gfx::Point left_top = w1->bounds().origin();
- aura::Window::ConvertPointToWindow(w1->parent(), root_window, &left_top);
+ aura::Window::ConvertPointToTarget(w1->parent(), root_window, &left_top);
left_top.Offset(1, 1);
generator.MoveMouseTo(left_top);
generator.ClickLeftButton();
@@ -322,8 +322,8 @@
// Touch window2.
gfx::Point press_point = w2->bounds().CenterPoint();
- aura::Window::ConvertPointToWindow(w2->parent(), root_window, &press_point);
- aura::TouchEvent touchev1(ui::ET_TOUCH_PRESSED, press_point, 0, getTime());
+ aura::Window::ConvertPointToTarget(w2->parent(), root_window, &press_point);
+ ui::TouchEventImpl touchev1(ui::ET_TOUCH_PRESSED, press_point, 0, getTime());
root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev1);
// Window2 should have become active.
@@ -338,9 +338,9 @@
// Touch window1, but set it up so w1 doesn't activate on touch.
press_point = w1->bounds().CenterPoint();
- aura::Window::ConvertPointToWindow(w1->parent(), root_window, &press_point);
+ aura::Window::ConvertPointToTarget(w1->parent(), root_window, &press_point);
d1.set_activate(false);
- aura::TouchEvent touchev2(ui::ET_TOUCH_PRESSED, press_point, 1, getTime());
+ ui::TouchEventImpl touchev2(ui::ET_TOUCH_PRESSED, press_point, 1, getTime());
root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev2);
// Window2 should still be active and focused.
@@ -382,12 +382,12 @@
// Create two mouse movement events we can switch between.
gfx::Point point1(kWindowLeft, kWindowTop);
- aura::Window::ConvertPointToWindow(window->parent(), root_window, &point1);
- aura::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1, 0x0);
+ aura::Window::ConvertPointToTarget(window->parent(), root_window, &point1);
+ ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1, 0x0);
gfx::Point point2(kWindowLeft + 1, kWindowTop + 1);
- aura::Window::ConvertPointToWindow(window->parent(), root_window, &point2);
- aura::MouseEvent move2(ui::ET_MOUSE_MOVED, point2, point2, 0x0);
+ aura::Window::ConvertPointToTarget(window->parent(), root_window, &point2);
+ ui::MouseEvent move2(ui::ET_MOUSE_MOVED, point2, point2, 0x0);
// Cursor starts as a pointer (set during Shell::Init()).
EXPECT_EQ(ui::kCursorPointer, root_window->last_cursor().native_type());
@@ -466,24 +466,24 @@
gfx::Point miss_point(5, 5);
transform.TransformPoint(miss_point);
- aura::MouseEvent mouseev1(ui::ET_MOUSE_PRESSED,
- miss_point,
- miss_point,
- ui::EF_LEFT_MOUSE_BUTTON);
+ ui::MouseEvent mouseev1(ui::ET_MOUSE_PRESSED,
+ miss_point,
+ miss_point,
+ ui::EF_LEFT_MOUSE_BUTTON);
root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouseev1);
EXPECT_FALSE(w1->GetFocusManager()->GetFocusedWindow());
- aura::MouseEvent mouseup(ui::ET_MOUSE_RELEASED,
- miss_point,
- miss_point,
- ui::EF_LEFT_MOUSE_BUTTON);
+ ui::MouseEvent mouseup(ui::ET_MOUSE_RELEASED,
+ miss_point,
+ miss_point,
+ ui::EF_LEFT_MOUSE_BUTTON);
root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouseup);
gfx::Point hit_point(5, 15);
transform.TransformPoint(hit_point);
- aura::MouseEvent mouseev2(ui::ET_MOUSE_PRESSED,
- hit_point,
- hit_point,
- ui::EF_LEFT_MOUSE_BUTTON);
+ ui::MouseEvent mouseev2(ui::ET_MOUSE_PRESSED,
+ hit_point,
+ hit_point,
+ ui::EF_LEFT_MOUSE_BUTTON);
root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouseev2);
EXPECT_TRUE(wm::IsActiveWindow(w1.get()));
EXPECT_EQ(w1.get(), w1->GetFocusManager()->GetFocusedWindow());
@@ -514,9 +514,9 @@
env_filter->AddFilter(f2.get());
// Dispatches mouse and keyboard events.
- aura::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, 0);
+ ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, 0);
root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&key_event);
- aura::MouseEvent mouse_pressed(
+ ui::MouseEvent mouse_pressed(
ui::ET_MOUSE_PRESSED, gfx::Point(0, 0), gfx::Point(0, 0), 0x0);
root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_pressed);
@@ -535,7 +535,7 @@
// Dispatches events.
root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&key_event);
- aura::MouseEvent mouse_released(
+ ui::MouseEvent mouse_released(
ui::ET_MOUSE_RELEASED, gfx::Point(0, 0), gfx::Point(0, 0), 0x0);
root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_released);
@@ -577,11 +577,11 @@
ash::CursorManager* cursor_manager =
ash::Shell::GetInstance()->cursor_manager();
- aura::MouseEvent mouse_moved(
+ ui::MouseEvent mouse_moved(
ui::ET_MOUSE_MOVED, gfx::Point(0, 0), gfx::Point(0, 0), 0x0);
- aura::TouchEvent touch_pressed1(
+ ui::TouchEventImpl touch_pressed1(
ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 0, getTime());
- aura::TouchEvent touch_pressed2(
+ ui::TouchEventImpl touch_pressed2(
ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 1, getTime());
env_filter->set_update_cursor_visibility(true);
« no previous file with comments | « ash/wm/window_cycle_controller.cc ('k') | ash/wm/window_modality_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698