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

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

Issue 9515003: Fix the full screen switching browser window dipping below launcher bar issue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the issue for managed window mode, add tests. Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base_layout_manager.h" 5 #include "ash/wm/base_layout_manager.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "ui/aura/client/aura_constants.h" 12 #include "ui/aura/client/aura_constants.h"
13 #include "ui/aura/root_window.h" 13 #include "ui/aura/root_window.h"
14 #include "ui/aura/screen_aura.h" 14 #include "ui/aura/screen_aura.h"
15 #include "ui/aura/test/test_windows.h" 15 #include "ui/aura/test/test_windows.h"
16 #include "ui/base/ui_base_types.h" 16 #include "ui/base/ui_base_types.h"
17 #include "ui/aura/window.h" 17 #include "ui/aura/window.h"
18 18
19 namespace ash { 19 namespace ash {
20 20
21 namespace { 21 namespace {
22 22
23 class BaseLayoutManagerTest : public test::AshTestBase { 23 class BaseLayoutManagerTest : public test::AshTestBase {
24 public: 24 public:
25 BaseLayoutManagerTest() {} 25 BaseLayoutManagerTest() {}
26 virtual ~BaseLayoutManagerTest() {} 26 virtual ~BaseLayoutManagerTest() {}
27 27
28 virtual void SetUp() OVERRIDE { 28 virtual void SetUp() OVERRIDE {
29 test::AshTestBase::SetUp(); 29 test::AshTestBase::SetUp();
30 Shell::GetRootWindow()->screen()->set_work_area_insets( 30 Shell::GetRootWindow()->SetScreenWorkAreaInsets(
31 gfx::Insets(1, 2, 3, 4)); 31 gfx::Insets(1, 2, 3, 4));
32 Shell::GetRootWindow()->SetHostSize(gfx::Size(800, 600)); 32 Shell::GetRootWindow()->SetHostSize(gfx::Size(800, 600));
33 aura::Window* default_container = Shell::GetInstance()->GetContainer( 33 aura::Window* default_container = Shell::GetInstance()->GetContainer(
34 internal::kShellWindowId_DefaultContainer); 34 internal::kShellWindowId_DefaultContainer);
35 default_container->SetLayoutManager(new internal::BaseLayoutManager); 35 default_container->SetLayoutManager(new internal::BaseLayoutManager);
36 } 36 }
37 37
38 aura::Window* CreateTestWindow(const gfx::Rect& bounds) { 38 aura::Window* CreateTestWindow(const gfx::Rect& bounds) {
39 return aura::test::CreateTestWindowWithBounds(bounds, NULL); 39 return aura::test::CreateTestWindowWithBounds(bounds, NULL);
40 } 40 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // Enlarging the root window does not change the window bounds. 138 // Enlarging the root window does not change the window bounds.
139 gfx::Rect old_bounds = window->bounds(); 139 gfx::Rect old_bounds = window->bounds();
140 Shell::GetRootWindow()->SetHostSize(gfx::Size(800, 600)); 140 Shell::GetRootWindow()->SetHostSize(gfx::Size(800, 600));
141 EXPECT_EQ(old_bounds.width(), window->bounds().width()); 141 EXPECT_EQ(old_bounds.width(), window->bounds().width());
142 EXPECT_EQ(old_bounds.height(), window->bounds().height()); 142 EXPECT_EQ(old_bounds.height(), window->bounds().height());
143 } 143 }
144 144
145 } // namespace 145 } // namespace
146 146
147 } // namespace ash 147 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698