OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/wm/workspace/phantom_window_controller.h" | 5 #include "ash/wm/workspace/phantom_window_controller.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
12 #include "ui/aura/window_event_dispatcher.h" | 12 #include "ui/aura/window_event_dispatcher.h" |
13 #include "ui/aura/window_observer.h" | 13 #include "ui/aura/window_observer.h" |
14 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
15 | 15 |
16 namespace ash { | 16 namespace ash { |
17 namespace internal { | |
18 | |
19 namespace { | 17 namespace { |
20 | 18 |
21 // Returns true if |window| is non-NULL and is visible. | 19 // Returns true if |window| is non-NULL and is visible. |
22 bool IsVisible(aura::Window* window) { | 20 bool IsVisible(aura::Window* window) { |
23 return window && window->IsVisible(); | 21 return window && window->IsVisible(); |
24 } | 22 } |
25 | 23 |
26 // Observes |window|'s deletion. | 24 // Observes |window|'s deletion. |
27 class WindowDeletionObserver : public aura::WindowObserver { | 25 class WindowDeletionObserver : public aura::WindowObserver { |
28 public: | 26 public: |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // Destroy phantom controller. Both windows should close. | 163 // Destroy phantom controller. Both windows should close. |
166 WindowDeletionObserver target_deletion_observer( | 164 WindowDeletionObserver target_deletion_observer( |
167 phantom_window_in_target_root()); | 165 phantom_window_in_target_root()); |
168 WindowDeletionObserver start_deletion_observer( | 166 WindowDeletionObserver start_deletion_observer( |
169 phantom_window_in_start_root()); | 167 phantom_window_in_start_root()); |
170 DeleteController(); | 168 DeleteController(); |
171 EXPECT_FALSE(target_deletion_observer.IsWindowAlive()); | 169 EXPECT_FALSE(target_deletion_observer.IsWindowAlive()); |
172 EXPECT_FALSE(start_deletion_observer.IsWindowAlive()); | 170 EXPECT_FALSE(start_deletion_observer.IsWindowAlive()); |
173 } | 171 } |
174 | 172 |
175 } // namespace internal | |
176 } // namespace ash | 173 } // namespace ash |
OLD | NEW |