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

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

Issue 12313118: Refactor: Shelf Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: safer shutdown (status_area_widget_) Created 7 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_window_resizer.cc ('k') | ash/wm/session_state_animator.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/wm/panels/panel_window_resizer.h" 5 #include "ash/wm/panels/panel_window_resizer.h"
6 6
7 #include "ash/launcher/launcher.h" 7 #include "ash/launcher/launcher.h"
8 #include "ash/shelf_types.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_types.h"
10 #include "ash/shelf/shelf_widget.h"
9 #include "ash/shell.h" 11 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 12 #include "ash/shell_window_ids.h"
11 #include "ash/test/ash_test_base.h" 13 #include "ash/test/ash_test_base.h"
12 #include "ash/test/cursor_manager_test_api.h" 14 #include "ash/test/cursor_manager_test_api.h"
13 #include "ash/test/test_launcher_delegate.h" 15 #include "ash/test/test_launcher_delegate.h"
14 #include "ash/wm/panels/panel_layout_manager.h" 16 #include "ash/wm/panels/panel_layout_manager.h"
15 #include "ash/wm/window_properties.h" 17 #include "ash/wm/window_properties.h"
16 #include "ui/aura/client/aura_constants.h" 18 #include "ui/aura/client/aura_constants.h"
17 #include "ui/aura/root_window.h" 19 #include "ui/aura/root_window.h"
18 #include "ui/aura/test/test_window_delegate.h" 20 #include "ui/aura/test/test_window_delegate.h"
19 #include "ui/base/hit_test.h" 21 #include "ui/base/hit_test.h"
20 #include "ui/base/ui_base_types.h" 22 #include "ui/base/ui_base_types.h"
21 #include "ui/views/widget/widget.h" 23 #include "ui/views/widget/widget.h"
22 24
23 namespace ash { 25 namespace ash {
24 namespace internal { 26 namespace internal {
25 27
26 class PanelWindowResizerTest : public test::AshTestBase { 28 class PanelWindowResizerTest : public test::AshTestBase {
27 public: 29 public:
28 PanelWindowResizerTest() : window_(NULL) {} 30 PanelWindowResizerTest() : window_(NULL) {}
29 virtual ~PanelWindowResizerTest() {} 31 virtual ~PanelWindowResizerTest() {}
30 32
31 virtual void SetUp() OVERRIDE { 33 virtual void SetUp() OVERRIDE {
32 AshTestBase::SetUp(); 34 AshTestBase::SetUp();
33 window_.reset(CreatePanelWindow(gfx::Rect(0, 0, 201, 201))); 35 window_.reset(CreatePanelWindow(gfx::Rect(0, 0, 201, 201)));
34 36
35 panel_layout_manager_ = static_cast<internal::PanelLayoutManager*>( 37 panel_layout_manager_ = static_cast<internal::PanelLayoutManager*>(
36 GetPanelContainer()->layout_manager()); 38 GetPanelContainer()->layout_manager());
37 launcher_bounds_ = panel_layout_manager_->launcher()->widget()-> 39 launcher_bounds_ = panel_layout_manager_->launcher()->shelf_widget()->
38 GetWindowBoundsInScreen(); 40 GetWindowBoundsInScreen();
39 } 41 }
40 42
41 virtual void TearDown() OVERRIDE { 43 virtual void TearDown() OVERRIDE {
42 window_.reset(); 44 window_.reset();
43 AshTestBase::TearDown(); 45 AshTestBase::TearDown();
44 } 46 }
45 47
46 protected: 48 protected:
47 gfx::Point CalculateDragPoint(const PanelWindowResizer& resizer, 49 gfx::Point CalculateDragPoint(const PanelWindowResizer& resizer,
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 172 }
171 173
172 TEST_F(PanelWindowResizerTest, PanelDetachReattachTop) { 174 TEST_F(PanelWindowResizerTest, PanelDetachReattachTop) {
173 ash::Shell* shell = ash::Shell::GetInstance(); 175 ash::Shell* shell = ash::Shell::GetInstance();
174 shell->SetShelfAlignment(SHELF_ALIGNMENT_TOP, shell->GetPrimaryRootWindow()); 176 shell->SetShelfAlignment(SHELF_ALIGNMENT_TOP, shell->GetPrimaryRootWindow());
175 DetachReattachTest(0, 1); 177 DetachReattachTest(0, 1);
176 } 178 }
177 179
178 } // namespace internal 180 } // namespace internal
179 } // namespace ash 181 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/panels/panel_window_resizer.cc ('k') | ash/wm/session_state_animator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698