OLD | NEW |
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/panel_layout_manager.h" | 5 #include "ash/wm/panel_layout_manager.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 virtual void SetUp() OVERRIDE { | 32 virtual void SetUp() OVERRIDE { |
33 ash::test::AshTestBase::SetUp(); | 33 ash::test::AshTestBase::SetUp(); |
34 ASSERT_TRUE(ash::test::TestLauncherDelegate::instance()); | 34 ASSERT_TRUE(ash::test::TestLauncherDelegate::instance()); |
35 | 35 |
36 launcher_view_test_.reset(new test::LauncherViewTestAPI( | 36 launcher_view_test_.reset(new test::LauncherViewTestAPI( |
37 Launcher::ForPrimaryDisplay()->GetLauncherViewForTest())); | 37 Launcher::ForPrimaryDisplay()->GetLauncherViewForTest())); |
38 launcher_view_test_->SetAnimationDuration(1); | 38 launcher_view_test_->SetAnimationDuration(1); |
39 } | 39 } |
40 | 40 |
41 aura::Window* CreateNormalWindow() { | 41 aura::Window* CreateNormalWindow() { |
42 return aura::test::CreateTestWindowWithBounds(gfx::Rect(), NULL); | 42 return CreateTestWindowInShellWithBounds(gfx::Rect()); |
43 } | 43 } |
44 | 44 |
45 aura::Window* CreatePanelWindow(const gfx::Rect& bounds) { | 45 aura::Window* CreatePanelWindow(const gfx::Rect& bounds) { |
46 aura::Window* window = aura::test::CreateTestWindowWithDelegateAndType( | 46 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( |
47 NULL, | 47 NULL, |
48 aura::client::WINDOW_TYPE_PANEL, | 48 aura::client::WINDOW_TYPE_PANEL, |
49 0, | 49 0, |
50 bounds, | 50 bounds); |
51 NULL /* parent should automatically become GetPanelContainer */); | |
52 ash::test::TestLauncherDelegate* launcher_delegate = | 51 ash::test::TestLauncherDelegate* launcher_delegate = |
53 ash::test::TestLauncherDelegate::instance(); | 52 ash::test::TestLauncherDelegate::instance(); |
54 launcher_delegate->AddLauncherItem(window); | 53 launcher_delegate->AddLauncherItem(window); |
55 PanelLayoutManager* manager = | 54 PanelLayoutManager* manager = |
56 static_cast<PanelLayoutManager*>(GetPanelContainer()->layout_manager()); | 55 static_cast<PanelLayoutManager*>(GetPanelContainer()->layout_manager()); |
57 manager->Relayout(); | 56 manager->Relayout(); |
58 return window; | 57 return window; |
59 } | 58 } |
60 | 59 |
61 aura::Window* GetPanelContainer() { | 60 aura::Window* GetPanelContainer() { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 wm::ActivateWindow(w2.get()); | 254 wm::ActivateWindow(w2.get()); |
256 // Windows should be stacked 1 < 2 > 3 | 255 // Windows should be stacked 1 < 2 > 3 |
257 w1.reset(); | 256 w1.reset(); |
258 EXPECT_NO_FATAL_FAILURE(IsPanelAboveLauncherIcon(w2.get())); | 257 EXPECT_NO_FATAL_FAILURE(IsPanelAboveLauncherIcon(w2.get())); |
259 EXPECT_NO_FATAL_FAILURE(IsPanelAboveLauncherIcon(w3.get())); | 258 EXPECT_NO_FATAL_FAILURE(IsPanelAboveLauncherIcon(w3.get())); |
260 EXPECT_TRUE(WindowIsAbove(w2.get(), w3.get())); | 259 EXPECT_TRUE(WindowIsAbove(w2.get(), w3.get())); |
261 } | 260 } |
262 | 261 |
263 } // namespace internal | 262 } // namespace internal |
264 } // namespace ash | 263 } // namespace ash |
OLD | NEW |