| 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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 | 470 |
| 471 } // namespace | 471 } // namespace |
| 472 | 472 |
| 473 // Various assertions around SetShelfAutoHideBehavior() and | 473 // Various assertions around SetShelfAutoHideBehavior() and |
| 474 // GetShelfAutoHideBehavior(). | 474 // GetShelfAutoHideBehavior(). |
| 475 TEST_F(ShellTest, ToggleAutoHide) { | 475 TEST_F(ShellTest, ToggleAutoHide) { |
| 476 scoped_ptr<aura::Window> window(new aura::Window(NULL)); | 476 scoped_ptr<aura::Window> window(new aura::Window(NULL)); |
| 477 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); | 477 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
| 478 window->SetType(aura::client::WINDOW_TYPE_NORMAL); | 478 window->SetType(aura::client::WINDOW_TYPE_NORMAL); |
| 479 window->Init(ui::LAYER_TEXTURED); | 479 window->Init(ui::LAYER_TEXTURED); |
| 480 SetDefaultParentByPrimaryRootWindow(window.get()); | 480 ParentWindowInPrimaryRootWindow(window.get()); |
| 481 window->Show(); | 481 window->Show(); |
| 482 wm::ActivateWindow(window.get()); | 482 wm::ActivateWindow(window.get()); |
| 483 | 483 |
| 484 Shell* shell = Shell::GetInstance(); | 484 Shell* shell = Shell::GetInstance(); |
| 485 aura::RootWindow* root_window = Shell::GetPrimaryRootWindow(); | 485 aura::RootWindow* root_window = Shell::GetPrimaryRootWindow(); |
| 486 shell->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, | 486 shell->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, |
| 487 root_window); | 487 root_window); |
| 488 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, | 488 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, |
| 489 shell->GetShelfAutoHideBehavior(root_window)); | 489 shell->GetShelfAutoHideBehavior(root_window)); |
| 490 shell->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER, | 490 shell->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 private: | 532 private: |
| 533 DISALLOW_COPY_AND_ASSIGN(ShellTest2); | 533 DISALLOW_COPY_AND_ASSIGN(ShellTest2); |
| 534 }; | 534 }; |
| 535 | 535 |
| 536 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { | 536 TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { |
| 537 window_.reset(new aura::Window(NULL)); | 537 window_.reset(new aura::Window(NULL)); |
| 538 window_->Init(ui::LAYER_NOT_DRAWN); | 538 window_->Init(ui::LAYER_NOT_DRAWN); |
| 539 } | 539 } |
| 540 | 540 |
| 541 } // namespace ash | 541 } // namespace ash |
| OLD | NEW |