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

Side by Side Diff: ash/wm/workspace_controller_unittest.cc

Issue 1913473002: Makes WorkspaceWindowResizer use ash/wm/common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@root_controller_observer
Patch Set: fix exo again Created 4 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
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer_unittest.cc ('k') | components/exo/shell_surface.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/wm/workspace_controller.h" 5 #include "ash/wm/workspace_controller.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/screen_util.h" 10 #include "ash/screen_util.h"
11 #include "ash/shelf/shelf_layout_manager.h" 11 #include "ash/shelf/shelf_layout_manager.h"
12 #include "ash/shelf/shelf_widget.h" 12 #include "ash/shelf/shelf_widget.h"
13 #include "ash/shell.h" 13 #include "ash/shell.h"
14 #include "ash/shell_window_ids.h" 14 #include "ash/shell_window_ids.h"
15 #include "ash/system/status_area_widget.h" 15 #include "ash/system/status_area_widget.h"
16 #include "ash/test/ash_test_base.h" 16 #include "ash/test/ash_test_base.h"
17 #include "ash/test/shell_test_api.h" 17 #include "ash/test/shell_test_api.h"
18 #include "ash/test/test_shelf_delegate.h" 18 #include "ash/test/test_shelf_delegate.h"
19 #include "ash/wm/aura/wm_window_aura.h"
19 #include "ash/wm/panels/panel_layout_manager.h" 20 #include "ash/wm/panels/panel_layout_manager.h"
20 #include "ash/wm/window_state.h" 21 #include "ash/wm/window_state.h"
21 #include "ash/wm/window_state_aura.h" 22 #include "ash/wm/window_state_aura.h"
22 #include "ash/wm/window_util.h" 23 #include "ash/wm/window_util.h"
23 #include "ash/wm/workspace/workspace_window_resizer.h" 24 #include "ash/wm/workspace/workspace_window_resizer.h"
24 #include "base/strings/string_number_conversions.h" 25 #include "base/strings/string_number_conversions.h"
25 #include "ui/aura/client/aura_constants.h" 26 #include "ui/aura/client/aura_constants.h"
26 #include "ui/aura/test/test_window_delegate.h" 27 #include "ui/aura/test/test_window_delegate.h"
27 #include "ui/aura/test/test_windows.h" 28 #include "ui/aura/test/test_windows.h"
28 #include "ui/aura/window.h" 29 #include "ui/aura/window.h"
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 // Auto positioning pushes windows to each sides. 1056 // Auto positioning pushes windows to each sides.
1056 EXPECT_EQ("0,0 100x100", window1->bounds().ToString()); 1057 EXPECT_EQ("0,0 100x100", window1->bounds().ToString());
1057 EXPECT_EQ("300,0 100x100", window2->bounds().ToString()); 1058 EXPECT_EQ("300,0 100x100", window2->bounds().ToString());
1058 1059
1059 window2->Hide(); 1060 window2->Hide();
1060 // Restores to the center. 1061 // Restores to the center.
1061 EXPECT_EQ("150,0 100x100", window1->bounds().ToString()); 1062 EXPECT_EQ("150,0 100x100", window1->bounds().ToString());
1062 1063
1063 // A user moved the window. 1064 // A user moved the window.
1064 std::unique_ptr<WindowResizer> resizer( 1065 std::unique_ptr<WindowResizer> resizer(
1065 CreateWindowResizer(window1.get(), gfx::Point(), HTCAPTION, 1066 CreateWindowResizer(wm::WmWindowAura::Get(window1.get()), gfx::Point(),
1066 aura::client::WINDOW_MOVE_SOURCE_MOUSE) 1067 HTCAPTION, aura::client::WINDOW_MOVE_SOURCE_MOUSE)
1067 .release()); 1068 .release());
1068 gfx::Point location = resizer->GetInitialLocation(); 1069 gfx::Point location = resizer->GetInitialLocation();
1069 location.Offset(-50, 0); 1070 location.Offset(-50, 0);
1070 resizer->Drag(location, 0); 1071 resizer->Drag(location, 0);
1071 resizer->CompleteDrag(); 1072 resizer->CompleteDrag();
1072 1073
1073 window1_state->set_bounds_changed_by_user(true); 1074 window1_state->set_bounds_changed_by_user(true);
1074 window1->SetBounds(gfx::Rect(100, 0, 100, 100)); 1075 window1->SetBounds(gfx::Rect(100, 0, 100, 100));
1075 1076
1076 window2->Show(); 1077 window2->Show();
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 ui::EventTimeForNow()); 1609 ui::EventTimeForNow());
1609 target = targeter->FindTargetForEvent(root, &touch); 1610 target = targeter->FindTargetForEvent(root, &touch);
1610 if (points[i].is_target_hit) 1611 if (points[i].is_target_hit)
1611 EXPECT_EQ(window.get(), target); 1612 EXPECT_EQ(window.get(), target);
1612 else 1613 else
1613 EXPECT_NE(window.get(), target); 1614 EXPECT_NE(window.get(), target);
1614 } 1615 }
1615 } 1616 }
1616 1617
1617 } // namespace ash 1618 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer_unittest.cc ('k') | components/exo/shell_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698