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/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 views::MenuItemView::TOPLEFT, ui::MENU_SOURCE_MOUSE, | 388 views::MenuItemView::TOPLEFT, ui::MENU_SOURCE_MOUSE, |
389 views::MenuRunner::CONTEXT_MENU)); | 389 views::MenuRunner::CONTEXT_MENU)); |
390 } | 390 } |
391 | 391 |
392 TEST_F(ShellTest, ManagedWindowModeBasics) { | 392 TEST_F(ShellTest, ManagedWindowModeBasics) { |
393 Shell* shell = Shell::GetInstance(); | 393 Shell* shell = Shell::GetInstance(); |
394 Shell::TestApi test_api(shell); | 394 Shell::TestApi test_api(shell); |
395 | 395 |
396 // We start with the usual window containers. | 396 // We start with the usual window containers. |
397 ExpectAllContainers(); | 397 ExpectAllContainers(); |
398 // Launcher is visible. | 398 // Shelf is visible. |
399 ShelfWidget* launcher_widget = Launcher::ForPrimaryDisplay()->shelf_widget(); | 399 ShelfWidget* launcher_widget = Launcher::ForPrimaryDisplay()->shelf_widget(); |
400 EXPECT_TRUE(launcher_widget->IsVisible()); | 400 EXPECT_TRUE(launcher_widget->IsVisible()); |
401 // Launcher is at bottom-left of screen. | 401 // Shelf is at bottom-left of screen. |
402 EXPECT_EQ(0, launcher_widget->GetWindowBoundsInScreen().x()); | 402 EXPECT_EQ(0, launcher_widget->GetWindowBoundsInScreen().x()); |
403 EXPECT_EQ( | 403 EXPECT_EQ( |
404 Shell::GetPrimaryRootWindow()->GetDispatcher()->GetHostSize().height(), | 404 Shell::GetPrimaryRootWindow()->GetDispatcher()->GetHostSize().height(), |
405 launcher_widget->GetWindowBoundsInScreen().bottom()); | 405 launcher_widget->GetWindowBoundsInScreen().bottom()); |
406 // We have a desktop background but not a bare layer. | 406 // We have a desktop background but not a bare layer. |
407 // TODO (antrim): enable once we find out why it fails component build. | 407 // TODO (antrim): enable once we find out why it fails component build. |
408 // internal::DesktopBackgroundWidgetController* background = | 408 // internal::DesktopBackgroundWidgetController* background = |
409 // Shell::GetPrimaryRootWindow()-> | 409 // Shell::GetPrimaryRootWindow()-> |
410 // GetProperty(internal::kWindowDesktopComponent); | 410 // GetProperty(internal::kWindowDesktopComponent); |
411 // EXPECT_TRUE(background); | 411 // EXPECT_TRUE(background); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 private: | 531 private: |
532 DISALLOW_COPY_AND_ASSIGN(ShellTest2); | 532 DISALLOW_COPY_AND_ASSIGN(ShellTest2); |
533 }; | 533 }; |
534 | 534 |
535 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { | 535 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { |
536 window_.reset(new aura::Window(NULL)); | 536 window_.reset(new aura::Window(NULL)); |
537 window_->Init(ui::LAYER_NOT_DRAWN); | 537 window_->Init(ui::LAYER_NOT_DRAWN); |
538 } | 538 } |
539 | 539 |
540 } // namespace ash | 540 } // namespace ash |
OLD | NEW |