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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 352 |
353 } // namespace | 353 } // namespace |
354 | 354 |
355 // Various assertions around IsAutoHideMenuHideChecked() and | 355 // Various assertions around IsAutoHideMenuHideChecked() and |
356 // ToggleAutoHideMenu(). | 356 // ToggleAutoHideMenu(). |
357 TEST_F(ShellTest, ToggleAutoHide) { | 357 TEST_F(ShellTest, ToggleAutoHide) { |
358 scoped_ptr<aura::Window> window(new aura::Window(NULL)); | 358 scoped_ptr<aura::Window> window(new aura::Window(NULL)); |
359 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); | 359 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
360 window->SetType(aura::client::WINDOW_TYPE_NORMAL); | 360 window->SetType(aura::client::WINDOW_TYPE_NORMAL); |
361 window->Init(ui::LAYER_TEXTURED); | 361 window->Init(ui::LAYER_TEXTURED); |
362 window->SetParent(NULL); | 362 SetDefaultParentByPrimaryRootWindow(window.get()); |
363 window->Show(); | 363 window->Show(); |
364 wm::ActivateWindow(window.get()); | 364 wm::ActivateWindow(window.get()); |
365 | 365 |
366 internal::RootWindowController* controller = | 366 internal::RootWindowController* controller = |
367 Shell::GetPrimaryRootWindowController(); | 367 Shell::GetPrimaryRootWindowController(); |
368 controller->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 368 controller->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
369 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, | 369 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, |
370 controller->GetShelfAutoHideBehavior()); | 370 controller->GetShelfAutoHideBehavior()); |
371 EXPECT_TRUE(controller->IsShelfAutoHideMenuHideChecked()); | 371 EXPECT_TRUE(controller->IsShelfAutoHideMenuHideChecked()); |
372 controller->SetShelfAutoHideBehavior( | 372 controller->SetShelfAutoHideBehavior( |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 private: | 405 private: |
406 DISALLOW_COPY_AND_ASSIGN(ShellTest2); | 406 DISALLOW_COPY_AND_ASSIGN(ShellTest2); |
407 }; | 407 }; |
408 | 408 |
409 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { | 409 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { |
410 window_.reset(new aura::Window(NULL)); | 410 window_.reset(new aura::Window(NULL)); |
411 window_->Init(ui::LAYER_NOT_DRAWN); | 411 window_->Init(ui::LAYER_NOT_DRAWN); |
412 } | 412 } |
413 | 413 |
414 } // namespace ash | 414 } // namespace ash |
OLD | NEW |