Commit 3738ee85 authored by Elliot Glaysher's avatar Elliot Glaysher Committed by Commit Bot

Start fixing ImmersiveFullscreenController tests.

The OnPointerEventObserved() interface acts differently between mash and
mus/classic. In mus/classic, the target window is taken from the
LocatedEvent's target(), relying on previous event dispatch metadata. On
mash, this event came from a remote service which hasn't been targeted,
target is therefore the top of the window tree. In the --mash case only,
target the event on the window and use that as the window we pass to the
rest of the system.

Bug: 698085
Change-Id: I8a1859055d9427b269cd5256c7ff114a1e97574d
Reviewed-on: https://chromium-review.googlesource.com/801976Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Commit-Queue: Elliot Glaysher <erg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521090}
parent 76f8804a
......@@ -55,6 +55,7 @@
#include "ui/aura/mus/window_tree_client.h"
#include "ui/aura/mus/window_tree_host_mus.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/class_property.h"
#include "ui/base/hit_test.h"
#include "ui/display/display_observer.h"
......@@ -308,7 +309,20 @@ void WindowManager::OnLostConnection(aura::WindowTreeClient* client) {
void WindowManager::OnPointerEventObserved(const ui::PointerEvent& event,
aura::Window* target) {
pointer_watcher_event_router_->OnPointerEventObserved(event, target);
DCHECK_EQ(Config::MASH, Shell::GetAshConfig());
// We have received a pointer event on |target|. However, we need to fixup
// |target| first. WindowManager's WindowTree is the entire root tree and
// we must adjust |target| from being the root to the aura::Window which
// would handle |event|.
std::unique_ptr<ui::Event> event_copy = ui::Event::Clone(event);
ui::EventTarget* e_target =
target->GetHost()
->dispatcher()
->GetDefaultEventTargeter()
->FindTargetForEvent(target, event_copy.get());
pointer_watcher_event_router_->OnPointerEventObserved(
event, static_cast<aura::Window*>(e_target));
}
aura::PropertyConverter* WindowManager::GetPropertyConverter() {
......
......@@ -54,15 +54,10 @@
# TODO: Top-of-screen mouse reveal doesn't work, maybe problem with
# EventGenerator. http://crbug.com/698085
-ImmersiveFullscreenControllerTest.Bubbles
-ImmersiveFullscreenControllerTest.Delegate
-ImmersiveFullscreenControllerTest.DifferentModalityEnterExit
-ImmersiveFullscreenControllerTest.EndRevealViaGesture
-ImmersiveFullscreenControllerTest.EventsDoNotLeakToWindowUnderneath
-ImmersiveFullscreenControllerTest.Focus
-ImmersiveFullscreenControllerTest.Inactive
-ImmersiveFullscreenControllerTest.MouseEventsVerticalDisplayLayout
-ImmersiveFullscreenControllerTest.MouseHoveredWithoutMoving
-ImmersiveFullscreenControllerTest.OnMouseEvent
-ImmersiveFullscreenControllerTest.RevealViaGestureChildConsumesEvents
-ImmersiveFullscreenControllerTest.Transient
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment