OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/solo_window_tracker.h" | 5 #include "ash/wm/solo_window_tracker.h" |
6 | 6 |
7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/screen_ash.h" | 10 #include "ash/screen_ash.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 // Constrained windows should not use solo headers. | 265 // Constrained windows should not use solo headers. |
266 TEST_F(SoloWindowTrackerTest, Constrained) { | 266 TEST_F(SoloWindowTrackerTest, Constrained) { |
267 scoped_ptr<aura::Window> w1(CreateWindowInPrimary()); | 267 scoped_ptr<aura::Window> w1(CreateWindowInPrimary()); |
268 w1->Show(); | 268 w1->Show(); |
269 | 269 |
270 // We only have one window, so it should use a solo header. | 270 // We only have one window, so it should use a solo header. |
271 EXPECT_EQ(w1.get(), GetWindowWithSoloHeaderInPrimary()); | 271 EXPECT_EQ(w1.get(), GetWindowWithSoloHeaderInPrimary()); |
272 | 272 |
273 // Create a fake constrained window. | 273 // Create a fake constrained window. |
274 scoped_ptr<aura::Window> w2(CreateWindowInPrimary()); | 274 scoped_ptr<aura::Window> w2(CreateWindowInPrimary()); |
275 w2->SetProperty(ash::kConstrainedWindowKey, true); | 275 w2->SetProperty(aura::client::kConstrainedWindowKey, true); |
276 w2->Show(); | 276 w2->Show(); |
277 | 277 |
278 // Despite two windows, the first window should still be considered "solo" | 278 // Despite two windows, the first window should still be considered "solo" |
279 // because constrained windows aren't included in the computation. | 279 // because constrained windows aren't included in the computation. |
280 EXPECT_EQ(w1.get(), GetWindowWithSoloHeaderInPrimary()); | 280 EXPECT_EQ(w1.get(), GetWindowWithSoloHeaderInPrimary()); |
281 } | 281 } |
282 | 282 |
283 // Non-drawing windows should not affect the solo computation. | 283 // Non-drawing windows should not affect the solo computation. |
284 TEST_F(SoloWindowTrackerTest, NotDrawn) { | 284 TEST_F(SoloWindowTrackerTest, NotDrawn) { |
285 aura::Window* w = CreateWindowInPrimary(); | 285 aura::Window* w = CreateWindowInPrimary(); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 w.reset(); | 414 w.reset(); |
415 EXPECT_EQ(NULL, GetWindowWithSoloHeaderInPrimary()); | 415 EXPECT_EQ(NULL, GetWindowWithSoloHeaderInPrimary()); |
416 | 416 |
417 // Recreate another window again. | 417 // Recreate another window again. |
418 w.reset(CreateWindowInPrimary()); | 418 w.reset(CreateWindowInPrimary()); |
419 w->Show(); | 419 w->Show(); |
420 EXPECT_EQ(w.get(), GetWindowWithSoloHeaderInPrimary()); | 420 EXPECT_EQ(w.get(), GetWindowWithSoloHeaderInPrimary()); |
421 } | 421 } |
422 | 422 |
423 } // namespace ash | 423 } // namespace ash |
OLD | NEW |