| 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/shelf_layout_manager.h" | 5 #include "ash/wm/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
| 8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 TEST_F(ShelfLayoutManagerTest, DontReferenceLauncherAfterDeletion) { | 155 TEST_F(ShelfLayoutManagerTest, DontReferenceLauncherAfterDeletion) { |
| 156 views::Widget* widget = new views::Widget; | 156 views::Widget* widget = new views::Widget; |
| 157 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 157 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
| 158 params.bounds = gfx::Rect(0, 0, 200, 200); | 158 params.bounds = gfx::Rect(0, 0, 200, 200); |
| 159 // Widget is now owned by the parent window. | 159 // Widget is now owned by the parent window. |
| 160 widget->Init(params); | 160 widget->Init(params); |
| 161 widget->SetFullscreen(true); | 161 widget->SetFullscreen(true); |
| 162 } | 162 } |
| 163 | 163 |
| 164 // Various assertions around auto-hide. | 164 // Various assertions around auto-hide. |
| 165 TEST_F(ShelfLayoutManagerTest, AutoHide) { | 165 TEST_F(ShelfLayoutManagerTest, DISABLED_AutoHide) { |
| 166 ShelfLayoutManager* shelf = GetShelfLayoutManager(); | 166 ShelfLayoutManager* shelf = GetShelfLayoutManager(); |
| 167 views::Widget* widget = new views::Widget; | 167 views::Widget* widget = new views::Widget; |
| 168 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 168 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
| 169 params.bounds = gfx::Rect(0, 0, 200, 200); | 169 params.bounds = gfx::Rect(0, 0, 200, 200); |
| 170 // Widget is now owned by the parent window. | 170 // Widget is now owned by the parent window. |
| 171 widget->Init(params); | 171 widget->Init(params); |
| 172 widget->Maximize(); | 172 widget->Maximize(); |
| 173 widget->Show(); | 173 widget->Show(); |
| 174 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); | 174 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE, shelf->visibility_state()); |
| 175 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 175 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 196 generator.MoveMouseTo(gfx::Point(0, 0)); | 196 generator.MoveMouseTo(gfx::Point(0, 0)); |
| 197 shelf->SetState(ShelfLayoutManager::AUTO_HIDE); | 197 shelf->SetState(ShelfLayoutManager::AUTO_HIDE); |
| 198 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 198 EXPECT_EQ(ShelfLayoutManager::AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
| 199 shelf->LayoutShelf(); | 199 shelf->LayoutShelf(); |
| 200 EXPECT_EQ(root->bounds().bottom() - ShelfLayoutManager::kAutoHideHeight, | 200 EXPECT_EQ(root->bounds().bottom() - ShelfLayoutManager::kAutoHideHeight, |
| 201 shelf->launcher_widget()->GetWindowScreenBounds().y()); | 201 shelf->launcher_widget()->GetWindowScreenBounds().y()); |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace internal | 204 } // namespace internal |
| 205 } // namespace ash | 205 } // namespace ash |
| OLD | NEW |