| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 const gfx::Point left_bezel_points[2] = { | 158 const gfx::Point left_bezel_points[2] = { |
| 159 gfx::Point(2, 10), gfx::Point(4, 20), | 159 gfx::Point(2, 10), gfx::Point(4, 20), |
| 160 }; | 160 }; |
| 161 const int kEventTimeSepration = 16; | 161 const int kEventTimeSepration = 16; |
| 162 int width = root_window()->bounds().width(); | 162 int width = root_window()->bounds().width(); |
| 163 generator.GestureMultiFingerScroll( | 163 generator.GestureMultiFingerScroll( |
| 164 2, left_bezel_points, kEventTimeSepration, 1, width, 0); | 164 2, left_bezel_points, kEventTimeSepration, 1, width, 0); |
| 165 EXPECT_TRUE(wm::IsActiveWindow(second.get())); | 165 EXPECT_TRUE(wm::IsActiveWindow(second.get())); |
| 166 EXPECT_EQ(second.get(), | 166 EXPECT_EQ(second.get(), |
| 167 wm_api.GetWindowListProvider()->GetWindowList().back()); | 167 wm_api.GetWindowListProvider()->GetWindowList().back()); |
| 168 EXPECT_FALSE(first->IsVisible()); | |
| 169 EXPECT_TRUE(second->IsVisible()); | |
| 170 EXPECT_FALSE(third->IsVisible()); | |
| 171 } | 168 } |
| 172 | 169 |
| 173 TEST_F(WindowManagerTest, TitleDragSwitchBetweenWindows) { | 170 TEST_F(WindowManagerTest, TitleDragSwitchBetweenWindows) { |
| 174 aura::test::TestWindowDelegate delegate; | 171 aura::test::TestWindowDelegate delegate; |
| 175 delegate.set_window_component(HTCAPTION); | 172 delegate.set_window_component(HTCAPTION); |
| 176 scoped_ptr<aura::Window> first(CreateWindow(&delegate)); | 173 scoped_ptr<aura::Window> first(CreateWindow(&delegate)); |
| 177 scoped_ptr<aura::Window> second(CreateWindow(&delegate)); | 174 scoped_ptr<aura::Window> second(CreateWindow(&delegate)); |
| 178 scoped_ptr<aura::Window> third(CreateWindow(&delegate)); | 175 scoped_ptr<aura::Window> third(CreateWindow(&delegate)); |
| 179 | 176 |
| 180 test::WindowManagerImplTestApi wm_api; | 177 test::WindowManagerImplTestApi wm_api; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 WindowOverviewModeDelegate* overview_delegate = wm_api.wm(); | 363 WindowOverviewModeDelegate* overview_delegate = wm_api.wm(); |
| 367 overview_delegate->OnSelectWindow(w1.get()); | 364 overview_delegate->OnSelectWindow(w1.get()); |
| 368 EXPECT_FALSE(wm_api.GetSplitViewController()->IsSplitViewModeActive()); | 365 EXPECT_FALSE(wm_api.GetSplitViewController()->IsSplitViewModeActive()); |
| 369 EXPECT_TRUE(w1->IsVisible()); | 366 EXPECT_TRUE(w1->IsVisible()); |
| 370 // Make sure the windows that were in split-view mode are hidden. | 367 // Make sure the windows that were in split-view mode are hidden. |
| 371 EXPECT_FALSE(w2->IsVisible()); | 368 EXPECT_FALSE(w2->IsVisible()); |
| 372 EXPECT_FALSE(w3->IsVisible()); | 369 EXPECT_FALSE(w3->IsVisible()); |
| 373 } | 370 } |
| 374 | 371 |
| 375 } // namespace athena | 372 } // namespace athena |
| OLD | NEW |