| 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/split_view_controller.h" | 5 #include "athena/wm/split_view_controller.h" |
| 6 | 6 |
| 7 #include "athena/screen/public/screen_manager.h" | 7 #include "athena/screen/public/screen_manager.h" |
| 8 #include "athena/test/base/athena_test_base.h" | 8 #include "athena/test/base/athena_test_base.h" |
| 9 #include "athena/test/base/test_windows.h" | 9 #include "athena/test/base/test_windows.h" |
| 10 #include "athena/wm/public/window_list_provider.h" | 10 #include "athena/wm/public/window_list_provider.h" |
| 11 #include "athena/wm/test/window_manager_impl_test_api.h" | 11 #include "athena/wm/test/window_manager_impl_test_api.h" |
| 12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
| 13 #include "ui/aura/test/test_window_delegate.h" | 13 #include "ui/aura/test/test_window_delegate.h" |
| 14 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
| 15 #include "ui/gfx/display.h" | 15 #include "ui/gfx/display.h" |
| 16 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
| 17 #include "ui/wm/core/window_util.h" | 17 #include "ui/wm/core/window_util.h" |
| 18 | 18 |
| 19 namespace athena { | 19 namespace athena { |
| 20 | 20 |
| 21 class SplitViewControllerTest : public test::AthenaTestBase { | 21 class SplitViewControllerTest : public test::AthenaTestBase { |
| 22 public: | 22 public: |
| 23 SplitViewControllerTest() {} | 23 SplitViewControllerTest() {} |
| 24 virtual ~SplitViewControllerTest() {} | 24 ~SplitViewControllerTest() override {} |
| 25 | 25 |
| 26 // test::AthenaTestBase: | 26 // test::AthenaTestBase: |
| 27 virtual void SetUp() override { | 27 void SetUp() override { |
| 28 test::AthenaTestBase::SetUp(); | 28 test::AthenaTestBase::SetUp(); |
| 29 api_.reset(new test::WindowManagerImplTestApi); | 29 api_.reset(new test::WindowManagerImplTestApi); |
| 30 } | 30 } |
| 31 | 31 |
| 32 virtual void TearDown() override { | 32 void TearDown() override { |
| 33 api_.reset(); | 33 api_.reset(); |
| 34 test::AthenaTestBase::TearDown(); | 34 test::AthenaTestBase::TearDown(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 // Returns the topmost window in z-order. | 37 // Returns the topmost window in z-order. |
| 38 const aura::Window* GetTopmostWindow() const { | 38 const aura::Window* GetTopmostWindow() const { |
| 39 return *api_->GetWindowListProvider()->GetWindowList().rbegin(); | 39 return *api_->GetWindowListProvider()->GetWindowList().rbegin(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 // Returns the second topmost window in z-order. | 42 // Returns the second topmost window in z-order. |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 // Entering splitview should now be disabled now that the screen is in a | 321 // Entering splitview should now be disabled now that the screen is in a |
| 322 // portrait orientation. | 322 // portrait orientation. |
| 323 EXPECT_FALSE(IsSplitViewAllowed()); | 323 EXPECT_FALSE(IsSplitViewAllowed()); |
| 324 | 324 |
| 325 // Rotating back to 0 allows splitview again. | 325 // Rotating back to 0 allows splitview again. |
| 326 ScreenManager::Get()->SetRotation(gfx::Display::ROTATE_0); | 326 ScreenManager::Get()->SetRotation(gfx::Display::ROTATE_0); |
| 327 EXPECT_TRUE(IsSplitViewAllowed()); | 327 EXPECT_TRUE(IsSplitViewAllowed()); |
| 328 } | 328 } |
| 329 | 329 |
| 330 } // namespace athena | 330 } // namespace athena |
| OLD | NEW |