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

Side by Side Diff: components/exo/shell_surface_unittest.cc

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse event constructor Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/shell_surface.h" 5 #include "components/exo/shell_surface.h"
6 #include "ash/common/accessibility_delegate.h" 6 #include "ash/common/accessibility_delegate.h"
7 #include "ash/common/wm/window_state.h" 7 #include "ash/common/wm/window_state.h"
8 #include "ash/common/wm/wm_event.h" 8 #include "ash/common/wm/wm_event.h"
9 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
10 #include "ash/common/wm_window.h" 10 #include "ash/common/wm_window.h"
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 surface.Commit(); 927 surface.Commit();
928 EXPECT_EQ(shadow_bounds, 928 EXPECT_EQ(shadow_bounds,
929 shell_surface.GetWidget()->GetWindowBoundsInScreen()); 929 shell_surface.GetWidget()->GetWindowBoundsInScreen());
930 ASSERT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); 930 ASSERT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds());
931 931
932 aura::Window* shell_window = shell_surface.GetWidget()->GetNativeWindow(); 932 aura::Window* shell_window = shell_surface.GetWidget()->GetNativeWindow();
933 aura::WindowTargeter* targeter = static_cast<aura::WindowTargeter*>( 933 aura::WindowTargeter* targeter = static_cast<aura::WindowTargeter*>(
934 static_cast<ui::EventTarget*>(shell_window)->GetEventTargeter()); 934 static_cast<ui::EventTarget*>(shell_window)->GetEventTargeter());
935 935
936 gfx::Point pt_out(300, 300); 936 gfx::Point pt_out(300, 300);
937 ui::MouseEvent ev_out(ui::ET_MOUSE_PRESSED, pt_out, pt_out, 937 ui::MouseEvent ev_out(
938 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 938 ui::ET_MOUSE_PRESSED, pt_out, pt_out, ui::EventTimeForNow(),
939 ui::EF_LEFT_MOUSE_BUTTON); 939 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
940 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
940 gfx::Point pt_in(70, 70); 941 gfx::Point pt_in(70, 70);
941 ui::MouseEvent ev_in(ui::ET_MOUSE_PRESSED, pt_in, pt_in, 942 ui::MouseEvent ev_in(
942 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 943 ui::ET_MOUSE_PRESSED, pt_in, pt_in, ui::EventTimeForNow(),
943 ui::EF_LEFT_MOUSE_BUTTON); 944 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
945 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
944 946
945 EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(shell_window, ev_out)); 947 EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(shell_window, ev_out));
946 948
947 // Enable spoken feedback. 949 // Enable spoken feedback.
948 ash::Shell::GetInstance()->accessibility_delegate()->ToggleSpokenFeedback( 950 ash::Shell::GetInstance()->accessibility_delegate()->ToggleSpokenFeedback(
949 ash::A11Y_NOTIFICATION_NONE); 951 ash::A11Y_NOTIFICATION_NONE);
950 shell_surface.OnAccessibilityModeChanged(); 952 shell_surface.OnAccessibilityModeChanged();
951 953
952 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().bounds(), 954 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().bounds(),
953 shell_surface.shadow_underlay()->bounds()); 955 shell_surface.shadow_underlay()->bounds());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 shell_surface.OnAccessibilityModeChanged(); 989 shell_surface.OnAccessibilityModeChanged();
988 shell_surface2.OnAccessibilityModeChanged(); 990 shell_surface2.OnAccessibilityModeChanged();
989 991
990 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); 992 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible());
991 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); 993 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds());
992 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); 994 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds());
993 } 995 }
994 996
995 } // namespace 997 } // namespace
996 } // namespace exo 998 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698