| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/html/shadow/MediaControlsOrientationLockDelegate.h" | 5 #include "core/html/shadow/MediaControlsOrientationLockDelegate.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/dom/DocumentUserGestureToken.h" | 8 #include "core/dom/DocumentUserGestureToken.h" |
| 9 #include "core/dom/Fullscreen.h" | 9 #include "core/dom/Fullscreen.h" |
| 10 #include "core/frame/ScreenOrientationController.h" | 10 #include "core/frame/ScreenOrientationController.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 std::unique_ptr<WebLockOrientationCallback>) override { | 85 std::unique_ptr<WebLockOrientationCallback>) override { |
| 86 m_locked = true; | 86 m_locked = true; |
| 87 lock(type); | 87 lock(type); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void unlock() override { | 90 void unlock() override { |
| 91 m_locked = false; | 91 m_locked = false; |
| 92 mockUnlock(); | 92 mockUnlock(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void notifyOrientationChanged() override {} |
| 96 |
| 95 bool maybeHasActiveLock() const override { return m_locked; } | 97 bool maybeHasActiveLock() const override { return m_locked; } |
| 96 | 98 |
| 97 bool m_locked = false; | 99 bool m_locked = false; |
| 98 }; | 100 }; |
| 99 | 101 |
| 100 } // anonymous namespace | 102 } // anonymous namespace |
| 101 | 103 |
| 102 class MediaControlsOrientationLockDelegateTest : public ::testing::Test { | 104 class MediaControlsOrientationLockDelegateTest : public ::testing::Test { |
| 103 protected: | 105 protected: |
| 104 void SetUp() override { | 106 void SetUp() override { |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 EXPECT_EQ(WebScreenOrientationLockLandscape, computeOrientationLock()); | 390 EXPECT_EQ(WebScreenOrientationLockLandscape, computeOrientationLock()); |
| 389 | 391 |
| 390 screenInfo.orientationType = WebScreenOrientationLandscapeSecondary; | 392 screenInfo.orientationType = WebScreenOrientationLandscapeSecondary; |
| 391 EXPECT_CALL(chromeClient(), screenInfo()) | 393 EXPECT_CALL(chromeClient(), screenInfo()) |
| 392 .Times(1) | 394 .Times(1) |
| 393 .WillOnce(Return(screenInfo)); | 395 .WillOnce(Return(screenInfo)); |
| 394 EXPECT_EQ(WebScreenOrientationLockLandscape, computeOrientationLock()); | 396 EXPECT_EQ(WebScreenOrientationLockLandscape, computeOrientationLock()); |
| 395 } | 397 } |
| 396 | 398 |
| 397 } // namespace blink | 399 } // namespace blink |
| OLD | NEW |