| 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/ash_switches.h" | 5 #include "ash/ash_switches.h" |
| 6 #include "ash/launcher/launcher.h" | 6 #include "ash/launcher/launcher.h" |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 Shell::TestApi test_api(shell); | 260 Shell::TestApi test_api(shell); |
| 261 | 261 |
| 262 // We start with the usual window containers. | 262 // We start with the usual window containers. |
| 263 ExpectAllContainers(); | 263 ExpectAllContainers(); |
| 264 // We have a default container event filter (for window drags). | 264 // We have a default container event filter (for window drags). |
| 265 EXPECT_TRUE(GetDefaultContainer()->event_filter()); | 265 EXPECT_TRUE(GetDefaultContainer()->event_filter()); |
| 266 // Launcher is visible. | 266 // Launcher is visible. |
| 267 views::Widget* launcher_widget = shell->launcher()->widget(); | 267 views::Widget* launcher_widget = shell->launcher()->widget(); |
| 268 EXPECT_TRUE(launcher_widget->IsVisible()); | 268 EXPECT_TRUE(launcher_widget->IsVisible()); |
| 269 // Launcher is at bottom-left of screen. | 269 // Launcher is at bottom-left of screen. |
| 270 EXPECT_EQ(0, launcher_widget->GetWindowScreenBounds().x()); | 270 EXPECT_EQ(0, launcher_widget->GetWindowBoundsInScreen().x()); |
| 271 EXPECT_EQ(Shell::GetPrimaryRootWindow()->GetHostSize().height(), | 271 EXPECT_EQ(Shell::GetPrimaryRootWindow()->GetHostSize().height(), |
| 272 launcher_widget->GetWindowScreenBounds().bottom()); | 272 launcher_widget->GetWindowBoundsInScreen().bottom()); |
| 273 // We have a desktop background but not a bare layer. | 273 // We have a desktop background but not a bare layer. |
| 274 EXPECT_TRUE(test_api.root_window_layout()->background_widget()); | 274 EXPECT_TRUE(test_api.root_window_layout()->background_widget()); |
| 275 EXPECT_FALSE(test_api.root_window_layout()->background_layer()); | 275 EXPECT_FALSE(test_api.root_window_layout()->background_layer()); |
| 276 | 276 |
| 277 // Create a normal window. It is not maximized. | 277 // Create a normal window. It is not maximized. |
| 278 views::Widget::InitParams widget_params( | 278 views::Widget::InitParams widget_params( |
| 279 views::Widget::InitParams::TYPE_WINDOW); | 279 views::Widget::InitParams::TYPE_WINDOW); |
| 280 widget_params.bounds.SetRect(11, 22, 300, 400); | 280 widget_params.bounds.SetRect(11, 22, 300, 400); |
| 281 views::Widget* widget = CreateTestWindow(widget_params); | 281 views::Widget* widget = CreateTestWindow(widget_params); |
| 282 widget->Show(); | 282 widget->Show(); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 private: | 333 private: |
| 334 DISALLOW_COPY_AND_ASSIGN(ShellTest2); | 334 DISALLOW_COPY_AND_ASSIGN(ShellTest2); |
| 335 }; | 335 }; |
| 336 | 336 |
| 337 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { | 337 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { |
| 338 window_.reset(new aura::Window(NULL)); | 338 window_.reset(new aura::Window(NULL)); |
| 339 window_->Init(ui::LAYER_NOT_DRAWN); | 339 window_->Init(ui::LAYER_NOT_DRAWN); |
| 340 } | 340 } |
| 341 | 341 |
| 342 } // namespace ash | 342 } // namespace ash |
| OLD | NEW |