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/window_watcher.h" | 5 #include "ash/shell/window_watcher.h" |
6 | 6 |
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/shell_delegate_impl.h" | 9 #include "ash/shell/shell_delegate_impl.h" |
10 #include "ash/system/user/login_status.h" | 10 #include "ash/system/user/login_status.h" |
11 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
12 #include "ui/aura/window_event_dispatcher.h" | 12 #include "ui/aura/window_event_dispatcher.h" |
13 | 13 |
14 namespace ash { | 14 namespace ash { |
15 | 15 |
16 typedef test::AshTestBase WindowWatcherTest; | 16 typedef test::AshTestBase WindowWatcherTest; |
17 | 17 |
18 // This test verifies that shell can be torn down without causing failures | 18 // This test verifies that shell can be torn down without causing failures |
19 // bug http://code.google.com/p/chromium/issues/detail?id=130332 | 19 // bug http://code.google.com/p/chromium/issues/detail?id=130332 |
20 TEST_F(WindowWatcherTest, ShellDeleteInstance) { | 20 TEST_F(WindowWatcherTest, ShellDeleteInstance) { |
21 RunAllPendingInMessageLoop(); | 21 RunAllPendingInMessageLoop(); |
22 scoped_ptr<ash::shell::WindowWatcher> window_watcher; | 22 scoped_ptr<ash::shell::WindowWatcher> window_watcher; |
23 Shell::DeleteInstance(); | 23 Shell::DeleteInstance(); |
24 | 24 |
25 shell::ShellDelegateImpl* delegate = new ash::shell::ShellDelegateImpl; | 25 shell::ShellDelegateImpl* delegate = new ash::shell::ShellDelegateImpl; |
26 Shell::CreateInstance(delegate); | 26 Shell::CreateInstance(delegate); |
27 Shell::GetPrimaryRootWindow()->GetDispatcher()->host()->Show(); | 27 Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
28 Shell::GetInstance()->CreateShelf(); | 28 Shell::GetInstance()->CreateShelf(); |
29 Shell::GetInstance()->UpdateAfterLoginStatusChange( | 29 Shell::GetInstance()->UpdateAfterLoginStatusChange( |
30 user::LOGGED_IN_USER); | 30 user::LOGGED_IN_USER); |
31 | 31 |
32 window_watcher.reset(new ash::shell::WindowWatcher); | 32 window_watcher.reset(new ash::shell::WindowWatcher); |
33 | 33 |
34 delegate->SetWatcher(window_watcher.get()); | 34 delegate->SetWatcher(window_watcher.get()); |
35 Shell::GetPrimaryRootWindow()->Hide(); | 35 Shell::GetPrimaryRootWindow()->Hide(); |
36 window_watcher.reset(); | 36 window_watcher.reset(); |
37 delegate->SetWatcher(NULL); | 37 delegate->SetWatcher(NULL); |
38 } | 38 } |
39 | 39 |
40 } // namespace ash | 40 } // namespace ash |
OLD | NEW |