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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 } | 391 } |
392 | 392 |
393 TEST_F(ShellTest, ManagedWindowModeBasics) { | 393 TEST_F(ShellTest, ManagedWindowModeBasics) { |
394 // We start with the usual window containers. | 394 // We start with the usual window containers. |
395 ExpectAllContainers(); | 395 ExpectAllContainers(); |
396 // Shelf is visible. | 396 // Shelf is visible. |
397 ShelfWidget* shelf_widget = Shelf::ForPrimaryDisplay()->shelf_widget(); | 397 ShelfWidget* shelf_widget = Shelf::ForPrimaryDisplay()->shelf_widget(); |
398 EXPECT_TRUE(shelf_widget->IsVisible()); | 398 EXPECT_TRUE(shelf_widget->IsVisible()); |
399 // Shelf is at bottom-left of screen. | 399 // Shelf is at bottom-left of screen. |
400 EXPECT_EQ(0, shelf_widget->GetWindowBoundsInScreen().x()); | 400 EXPECT_EQ(0, shelf_widget->GetWindowBoundsInScreen().x()); |
401 EXPECT_EQ(Shell::GetPrimaryRootWindow()->GetDispatcher()->host()-> | 401 EXPECT_EQ(Shell::GetPrimaryRootWindow()->GetHost()->GetBounds().height(), |
402 GetBounds().height(), | 402 shelf_widget->GetWindowBoundsInScreen().bottom()); |
403 shelf_widget->GetWindowBoundsInScreen().bottom()); | |
404 // We have a desktop background but not a bare layer. | 403 // We have a desktop background but not a bare layer. |
405 // TODO (antrim): enable once we find out why it fails component build. | 404 // TODO (antrim): enable once we find out why it fails component build. |
406 // internal::DesktopBackgroundWidgetController* background = | 405 // internal::DesktopBackgroundWidgetController* background = |
407 // Shell::GetPrimaryRootWindow()-> | 406 // Shell::GetPrimaryRootWindow()-> |
408 // GetProperty(internal::kWindowDesktopComponent); | 407 // GetProperty(internal::kWindowDesktopComponent); |
409 // EXPECT_TRUE(background); | 408 // EXPECT_TRUE(background); |
410 // EXPECT_TRUE(background->widget()); | 409 // EXPECT_TRUE(background->widget()); |
411 // EXPECT_FALSE(background->layer()); | 410 // EXPECT_FALSE(background->layer()); |
412 | 411 |
413 // Create a normal window. It is not maximized. | 412 // Create a normal window. It is not maximized. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 private: | 528 private: |
530 DISALLOW_COPY_AND_ASSIGN(ShellTest2); | 529 DISALLOW_COPY_AND_ASSIGN(ShellTest2); |
531 }; | 530 }; |
532 | 531 |
533 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { | 532 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { |
534 window_.reset(new aura::Window(NULL)); | 533 window_.reset(new aura::Window(NULL)); |
535 window_->Init(aura::WINDOW_LAYER_NOT_DRAWN); | 534 window_->Init(aura::WINDOW_LAYER_NOT_DRAWN); |
536 } | 535 } |
537 | 536 |
538 } // namespace ash | 537 } // namespace ash |
OLD | NEW |