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

Side by Side Diff: ash/wm/panels/panel_window_resizer_unittest.cc

Issue 2731663002: Remove WmWindowProperty (Closed)
Patch Set: rebase 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/wm/panels/panel_layout_manager_unittest.cc ('k') | ash/wm/window_mirror_view.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/common/wm/panels/panel_window_resizer.h" 5 #include "ash/common/wm/panels/panel_window_resizer.h"
6 6
7 #include "ash/common/shelf/shelf_layout_manager.h" 7 #include "ash/common/shelf/shelf_layout_manager.h"
8 #include "ash/common/shelf/shelf_model.h" 8 #include "ash/common/shelf/shelf_model.h"
9 #include "ash/common/shelf/shelf_widget.h" 9 #include "ash/common/shelf/shelf_widget.h"
10 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
11 #include "ash/common/test/test_shelf_delegate.h" 11 #include "ash/common/test/test_shelf_delegate.h"
12 #include "ash/common/wm/window_state.h" 12 #include "ash/common/wm/window_state.h"
13 #include "ash/common/wm/wm_event.h" 13 #include "ash/common/wm/wm_event.h"
14 #include "ash/common/wm_shell.h" 14 #include "ash/common/wm_shell.h"
15 #include "ash/common/wm_window.h" 15 #include "ash/common/wm_window.h"
16 #include "ash/common/wm_window_property.h"
17 #include "ash/public/cpp/shelf_types.h" 16 #include "ash/public/cpp/shelf_types.h"
18 #include "ash/public/cpp/shell_window_ids.h" 17 #include "ash/public/cpp/shell_window_ids.h"
19 #include "ash/public/cpp/window_properties.h" 18 #include "ash/public/cpp/window_properties.h"
20 #include "ash/root_window_controller.h" 19 #include "ash/root_window_controller.h"
21 #include "ash/shell.h" 20 #include "ash/shell.h"
22 #include "ash/test/ash_test_base.h" 21 #include "ash/test/ash_test_base.h"
23 #include "ash/test/cursor_manager_test_api.h" 22 #include "ash/test/cursor_manager_test_api.h"
24 #include "ash/wm/drag_window_resizer.h" 23 #include "ash/wm/drag_window_resizer.h"
24 #include "ash/wm/window_properties.h"
25 #include "ash/wm/window_state_aura.h" 25 #include "ash/wm/window_state_aura.h"
26 #include "base/i18n/rtl.h" 26 #include "base/i18n/rtl.h"
27 #include "ui/aura/client/aura_constants.h" 27 #include "ui/aura/client/aura_constants.h"
28 #include "ui/aura/window_event_dispatcher.h" 28 #include "ui/aura/window_event_dispatcher.h"
29 #include "ui/base/hit_test.h" 29 #include "ui/base/hit_test.h"
30 #include "ui/base/ui_base_types.h" 30 #include "ui/base/ui_base_types.h"
31 #include "ui/views/widget/widget.h" 31 #include "ui/views/widget/widget.h"
32 #include "ui/wm/core/window_util.h" 32 #include "ui/wm/core/window_util.h"
33 33
34 namespace ash { 34 namespace ash {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 EXPECT_EQ(initial_bounds.y(), window->GetBoundsInScreen().y()); 125 EXPECT_EQ(initial_bounds.y(), window->GetBoundsInScreen().y());
126 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id()); 126 EXPECT_EQ(kShellWindowId_PanelContainer, window->parent()->id());
127 } 127 }
128 128
129 void TestWindowOrder(const std::vector<aura::Window*>& window_order) { 129 void TestWindowOrder(const std::vector<aura::Window*>& window_order) {
130 int panel_index = model_->FirstPanelIndex(); 130 int panel_index = model_->FirstPanelIndex();
131 EXPECT_EQ((int)(panel_index + window_order.size()), model_->item_count()); 131 EXPECT_EQ((int)(panel_index + window_order.size()), model_->item_count());
132 for (std::vector<aura::Window *>::const_iterator 132 for (std::vector<aura::Window *>::const_iterator
133 iter = window_order.begin(); 133 iter = window_order.begin();
134 iter != window_order.end(); ++iter, ++panel_index) { 134 iter != window_order.end(); ++iter, ++panel_index) {
135 ShelfID id = 135 ShelfID id = (*iter)->GetProperty(kShelfIDKey);
136 WmWindow::Get(*iter)->GetIntProperty(WmWindowProperty::SHELF_ID);
137 EXPECT_EQ(id, model_->items()[panel_index].id); 136 EXPECT_EQ(id, model_->items()[panel_index].id);
138 } 137 }
139 } 138 }
140 139
141 // Test dragging panel window along the shelf and verify that panel icons 140 // Test dragging panel window along the shelf and verify that panel icons
142 // are reordered appropriately. 141 // are reordered appropriately.
143 void DragAlongShelfReorder(int dx, int dy) { 142 void DragAlongShelfReorder(int dx, int dy) {
144 gfx::Point origin(0, 0); 143 gfx::Point origin(0, 0);
145 std::unique_ptr<aura::Window> w1(CreatePanelWindow(origin)); 144 std::unique_ptr<aura::Window> w1(CreatePanelWindow(origin));
146 std::unique_ptr<aura::Window> w2(CreatePanelWindow(origin)); 145 std::unique_ptr<aura::Window> w2(CreatePanelWindow(origin));
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 INSTANTIATE_TEST_CASE_P(LtrRtl, 515 INSTANTIATE_TEST_CASE_P(LtrRtl,
517 PanelWindowResizerTextDirectionTest, 516 PanelWindowResizerTextDirectionTest,
518 testing::Bool()); 517 testing::Bool());
519 INSTANTIATE_TEST_CASE_P(NormalPanelPopup, 518 INSTANTIATE_TEST_CASE_P(NormalPanelPopup,
520 PanelWindowResizerTransientTest, 519 PanelWindowResizerTransientTest,
521 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, 520 testing::Values(ui::wm::WINDOW_TYPE_NORMAL,
522 ui::wm::WINDOW_TYPE_PANEL, 521 ui::wm::WINDOW_TYPE_PANEL,
523 ui::wm::WINDOW_TYPE_POPUP)); 522 ui::wm::WINDOW_TYPE_POPUP));
524 523
525 } // namespace ash 524 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/panels/panel_layout_manager_unittest.cc ('k') | ash/wm/window_mirror_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698