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

Unified Diff: ash/wm/overview/window_selector_unittest.cc

Issue 2441813002: [ash-md] Prevents a crash when entering overview mode while dragging a window (Closed)
Patch Set: [ash-md] Prevents a crash when entering overview mode while dragging a window (adds test) Created 4 years, 2 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/common/wm/overview/window_selector_item.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/overview/window_selector_unittest.cc
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc
index 9b149d56b9d9a411f8cd12d59618b8dd2e9075f7..4f875aee66af70cc16887e041ad45e90d57ee369 100644
--- a/ash/wm/overview/window_selector_unittest.cc
+++ b/ash/wm/overview/window_selector_unittest.cc
@@ -23,6 +23,7 @@
#include "ash/common/wm/panels/panel_layout_manager.h"
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/wm_event.h"
+#include "ash/common/wm/workspace/workspace_window_resizer.h"
#include "ash/common/wm_lookup.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window_property.h"
@@ -54,6 +55,7 @@
#include "ui/aura/test/test_windows.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
+#include "ui/base/hit_test.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/display/manager/display_layout.h"
#include "ui/events/event_utils.h"
@@ -2017,4 +2019,20 @@ TEST_F(WindowSelectorTest, TransformedRectIsCenteredWithInset) {
bounds.bottom() - transformed_rect.bottom(), 1);
}
+// Start dragging a window and activate overview mode. This test should not
+// crash or DCHECK inside aura::Window::StackChildRelativeTo().
+TEST_F(WindowSelectorTest, OverviewWhileDragging) {
+ const gfx::Rect bounds(10, 10, 100, 100);
+ std::unique_ptr<aura::Window> window(CreateWindow(bounds));
+ std::unique_ptr<WindowResizer> resizer(
+ CreateWindowResizer(WmWindowAura::Get(window.get()), gfx::Point(),
+ HTCAPTION, aura::client::WINDOW_MOVE_SOURCE_MOUSE));
+ ASSERT_TRUE(resizer.get());
+ gfx::Point location = resizer->GetInitialLocation();
+ location.Offset(20, 20);
+ resizer->Drag(location, 0);
+ ToggleOverview();
+ resizer->RevertDrag();
+}
+
} // namespace ash
« no previous file with comments | « ash/common/wm/overview/window_selector_item.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698