| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chrome/browser/android/vr_shell/ui_scene_manager.h" | 5 #include "chrome/browser/android/vr_shell/ui_scene_manager.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "chrome/browser/android/vr_shell/ui_scene.h" | 8 #include "chrome/browser/android/vr_shell/ui_scene.h" |
| 9 #include "chrome/browser/android/vr_shell/vr_browser_interface.h" | 9 #include "chrome/browser/android/vr_shell/vr_browser_interface.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 MockBrowserInterface() {} | 21 MockBrowserInterface() {} |
| 22 ~MockBrowserInterface() override {} | 22 ~MockBrowserInterface() override {} |
| 23 | 23 |
| 24 MOCK_METHOD1(ContentSurfaceChanged, void(jobject)); | 24 MOCK_METHOD1(ContentSurfaceChanged, void(jobject)); |
| 25 MOCK_METHOD0(GvrDelegateReady, void()); | 25 MOCK_METHOD0(GvrDelegateReady, void()); |
| 26 MOCK_METHOD1(UpdateGamepadData, void(device::GvrGamepadData)); | 26 MOCK_METHOD1(UpdateGamepadData, void(device::GvrGamepadData)); |
| 27 MOCK_METHOD1(AppButtonGesturePerformed, void(UiInterface::Direction)); | 27 MOCK_METHOD1(AppButtonGesturePerformed, void(UiInterface::Direction)); |
| 28 | 28 |
| 29 MOCK_METHOD0(AppButtonClicked, void()); | 29 MOCK_METHOD0(AppButtonClicked, void()); |
| 30 MOCK_METHOD0(ForceExitVr, void()); | 30 MOCK_METHOD0(ForceExitVr, void()); |
| 31 MOCK_METHOD0(ExitFullscreen, void()); |
| 31 MOCK_METHOD2( | 32 MOCK_METHOD2( |
| 32 RunVRDisplayInfoCallback, | 33 RunVRDisplayInfoCallback, |
| 33 void(const base::Callback<void(device::mojom::VRDisplayInfoPtr)>&, | 34 void(const base::Callback<void(device::mojom::VRDisplayInfoPtr)>&, |
| 34 device::mojom::VRDisplayInfoPtr*)); | 35 device::mojom::VRDisplayInfoPtr*)); |
| 35 MOCK_METHOD1(OnContentPaused, void(bool)); | 36 MOCK_METHOD1(OnContentPaused, void(bool)); |
| 36 | 37 |
| 37 // Stub this as scoped pointers don't work as mock method parameters. | 38 // Stub this as scoped pointers don't work as mock method parameters. |
| 38 void ProcessContentGesture(std::unique_ptr<blink::WebInputEvent>) {} | 39 void ProcessContentGesture(std::unique_ptr<blink::WebInputEvent>) {} |
| 39 | 40 |
| 40 private: | 41 private: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 manager_->OnAppButtonClicked(); | 73 manager_->OnAppButtonClicked(); |
| 73 EXPECT_FALSE(scene_->GetWebVrRenderingEnabled()); | 74 EXPECT_FALSE(scene_->GetWebVrRenderingEnabled()); |
| 74 | 75 |
| 75 // Clicking it again should resume content rendering. | 76 // Clicking it again should resume content rendering. |
| 76 EXPECT_CALL(*browser_, OnContentPaused(false)).Times(1); | 77 EXPECT_CALL(*browser_, OnContentPaused(false)).Times(1); |
| 77 manager_->OnAppButtonClicked(); | 78 manager_->OnAppButtonClicked(); |
| 78 EXPECT_TRUE(scene_->GetWebVrRenderingEnabled()); | 79 EXPECT_TRUE(scene_->GetWebVrRenderingEnabled()); |
| 79 } | 80 } |
| 80 | 81 |
| 81 } // namespace vr_shell | 82 } // namespace vr_shell |
| OLD | NEW |