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 "athena/wm/public/window_manager.h" | 5 #include "athena/wm/public/window_manager.h" |
6 | 6 |
7 #include "athena/screen/public/screen_manager.h" | 7 #include "athena/screen/public/screen_manager.h" |
8 #include "athena/test/athena_test_base.h" | 8 #include "athena/test/athena_test_base.h" |
9 #include "athena/wm/public/window_list_provider.h" | 9 #include "athena/wm/public/window_list_provider.h" |
10 #include "athena/wm/split_view_controller.h" | 10 #include "athena/wm/split_view_controller.h" |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 308 |
309 // Toggle back to normal mode. | 309 // Toggle back to normal mode. |
310 generator.PressKey(ui::VKEY_F6, ui::EF_CONTROL_DOWN); | 310 generator.PressKey(ui::VKEY_F6, ui::EF_CONTROL_DOWN); |
311 generator.ReleaseKey(ui::VKEY_F6, ui::EF_CONTROL_DOWN); | 311 generator.ReleaseKey(ui::VKEY_F6, ui::EF_CONTROL_DOWN); |
312 EXPECT_FALSE(wm_api.GetSplitViewController()->IsSplitViewModeActive()); | 312 EXPECT_FALSE(wm_api.GetSplitViewController()->IsSplitViewModeActive()); |
313 | 313 |
314 EXPECT_EQ(width, w1->bounds().width()); | 314 EXPECT_EQ(width, w1->bounds().width()); |
315 EXPECT_EQ(width, w2->bounds().width()); | 315 EXPECT_EQ(width, w2->bounds().width()); |
316 } | 316 } |
317 | 317 |
| 318 TEST_F(WindowManagerTest, OverviewModeFromSplitMode) { |
| 319 test::WindowManagerImplTestApi wm_api; |
| 320 |
| 321 aura::test::TestWindowDelegate delegate; |
| 322 scoped_ptr<aura::Window> w1(CreateTestWindow(&delegate, gfx::Rect())); |
| 323 scoped_ptr<aura::Window> w2(CreateTestWindow(&delegate, gfx::Rect())); |
| 324 scoped_ptr<aura::Window> w3(CreateTestWindow(&delegate, gfx::Rect())); |
| 325 |
| 326 // Get into split-view mode, and then turn on overview mode. |
| 327 wm_api.GetSplitViewController()->ActivateSplitMode(NULL, NULL); |
| 328 WindowManager::GetInstance()->ToggleOverview(); |
| 329 EXPECT_TRUE(wm_api.GetSplitViewController()->IsSplitViewModeActive()); |
| 330 EXPECT_EQ(w3.get(), wm_api.GetSplitViewController()->left_window()); |
| 331 EXPECT_EQ(w2.get(), wm_api.GetSplitViewController()->right_window()); |
| 332 |
| 333 WindowOverviewModeDelegate* overview_delegate = wm_api.wm(); |
| 334 overview_delegate->OnSelectWindow(w1.get()); |
| 335 EXPECT_FALSE(wm_api.GetSplitViewController()->IsSplitViewModeActive()); |
| 336 } |
| 337 |
318 } // namespace athena | 338 } // namespace athena |
OLD | NEW |