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

Side by Side Diff: ash/wm/immersive_fullscreen_controller_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
« no previous file with comments | « ash/shelf/shelf_widget_unittest.cc ('k') | ash/wm/overview/window_selector_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/shared/immersive_fullscreen_controller.h" 5 #include "ash/shared/immersive_fullscreen_controller.h"
6 6
7 #include "ash/common/shelf/wm_shelf.h" 7 #include "ash/common/shelf/wm_shelf.h"
8 #include "ash/common/wm/window_state.h" 8 #include "ash/common/wm/window_state.h"
9 #include "ash/display/mouse_cursor_event_filter.h" 9 #include "ash/display/mouse_cursor_event_filter.h"
10 #include "ash/public/cpp/shelf_types.h" 10 #include "ash/public/cpp/shelf_types.h"
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 behind->Show(); 729 behind->Show();
730 behind->SetBounds(window_bounds); 730 behind->SetBounds(window_bounds);
731 widget()->StackAbove(behind.get()); 731 widget()->StackAbove(behind.get());
732 732
733 // Make sure the windows are aligned on top. 733 // Make sure the windows are aligned on top.
734 EXPECT_EQ(behind->GetBoundsInScreen().y(), window()->GetBoundsInScreen().y()); 734 EXPECT_EQ(behind->GetBoundsInScreen().y(), window()->GetBoundsInScreen().y());
735 int top = behind->GetBoundsInScreen().y(); 735 int top = behind->GetBoundsInScreen().y();
736 736
737 ui::TouchEvent touch(ui::ET_TOUCH_MOVED, gfx::Point(10, top), 0, 737 ui::TouchEvent touch(ui::ET_TOUCH_MOVED, gfx::Point(10, top), 0,
738 ui::EventTimeForNow()); 738 ui::EventTimeForNow());
739 ui::EventTarget* root = window()->GetRootWindow(); 739 aura::Window* root = window()->GetRootWindow();
740 ui::EventTargeter* targeter = root->GetEventTargeter(); 740 ui::EventTargeter* targeter =
741 root->GetHost()->dispatcher()->GetDefaultEventTargeter();
741 EXPECT_EQ(window(), targeter->FindTargetForEvent(root, &touch)); 742 EXPECT_EQ(window(), targeter->FindTargetForEvent(root, &touch));
742 743
743 SetEnabled(true); 744 SetEnabled(true);
744 EXPECT_FALSE(controller()->IsRevealed()); 745 EXPECT_FALSE(controller()->IsRevealed());
745 // Make sure the windows are still aligned on top. 746 // Make sure the windows are still aligned on top.
746 EXPECT_EQ(behind->GetBoundsInScreen().y(), window()->GetBoundsInScreen().y()); 747 EXPECT_EQ(behind->GetBoundsInScreen().y(), window()->GetBoundsInScreen().y());
747 top = behind->GetBoundsInScreen().y(); 748 top = behind->GetBoundsInScreen().y();
748 ui::TouchEvent touch2(ui::ET_TOUCH_MOVED, gfx::Point(10, top), 0, 749 ui::TouchEvent touch2(ui::ET_TOUCH_MOVED, gfx::Point(10, top), 0,
749 ui::EventTimeForNow()); 750 ui::EventTimeForNow());
750 // The event should still be targeted to window(). 751 // The event should still be targeted to window().
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 SetEnabled(true); 1032 SetEnabled(true);
1032 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); 1033 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
1033 1034
1034 // Disabling immersive fullscreen maintains the user's auto-hide selection. 1035 // Disabling immersive fullscreen maintains the user's auto-hide selection.
1035 SetEnabled(false); 1036 SetEnabled(false);
1036 window()->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); 1037 window()->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
1037 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); 1038 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState());
1038 } 1039 }
1039 1040
1040 } // namespase ash 1041 } // namespase ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_widget_unittest.cc ('k') | ash/wm/overview/window_selector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698