| 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/shell.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 ui::MENU_SOURCE_MOUSE)); | 364 ui::MENU_SOURCE_MOUSE)); |
| 365 } | 365 } |
| 366 | 366 |
| 367 TEST_F(ShellTest, ManagedWindowModeBasics) { | 367 TEST_F(ShellTest, ManagedWindowModeBasics) { |
| 368 if (!SupportsHostWindowResize()) | 368 if (!SupportsHostWindowResize()) |
| 369 return; | 369 return; |
| 370 | 370 |
| 371 // We start with the usual window containers. | 371 // We start with the usual window containers. |
| 372 ExpectAllContainers(); | 372 ExpectAllContainers(); |
| 373 // Shelf is visible. | 373 // Shelf is visible. |
| 374 ShelfWidget* shelf_widget = GetPrimaryShelf()->GetShelfWidgetForTesting(); | 374 ShelfWidget* shelf_widget = GetPrimaryShelf()->shelf_widget(); |
| 375 EXPECT_TRUE(shelf_widget->IsVisible()); | 375 EXPECT_TRUE(shelf_widget->IsVisible()); |
| 376 // Shelf is at bottom-left of screen. | 376 // Shelf is at bottom-left of screen. |
| 377 EXPECT_EQ(0, shelf_widget->GetWindowBoundsInScreen().x()); | 377 EXPECT_EQ(0, shelf_widget->GetWindowBoundsInScreen().x()); |
| 378 EXPECT_EQ(Shell::GetPrimaryRootWindow()->GetHost()->GetBounds().height(), | 378 EXPECT_EQ(Shell::GetPrimaryRootWindow()->GetHost()->GetBounds().height(), |
| 379 shelf_widget->GetWindowBoundsInScreen().bottom()); | 379 shelf_widget->GetWindowBoundsInScreen().bottom()); |
| 380 // We have a desktop background but not a bare layer. | 380 // We have a desktop background but not a bare layer. |
| 381 // TODO (antrim): enable once we find out why it fails component build. | 381 // TODO (antrim): enable once we find out why it fails component build. |
| 382 // DesktopBackgroundWidgetController* background = | 382 // DesktopBackgroundWidgetController* background = |
| 383 // Shell::GetPrimaryRootWindow()-> | 383 // Shell::GetPrimaryRootWindow()-> |
| 384 // GetProperty(kWindowDesktopComponent); | 384 // GetProperty(kWindowDesktopComponent); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 private: | 503 private: |
| 504 DISALLOW_COPY_AND_ASSIGN(ShellTest2); | 504 DISALLOW_COPY_AND_ASSIGN(ShellTest2); |
| 505 }; | 505 }; |
| 506 | 506 |
| 507 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { | 507 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { |
| 508 window_.reset(new aura::Window(NULL)); | 508 window_.reset(new aura::Window(NULL)); |
| 509 window_->Init(ui::LAYER_NOT_DRAWN); | 509 window_->Init(ui::LAYER_NOT_DRAWN); |
| 510 } | 510 } |
| 511 | 511 |
| 512 } // namespace ash | 512 } // namespace ash |
| OLD | NEW |