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 27 matching lines...) Expand all Loading... |
38 | 38 |
39 class MockVideoWebMediaPlayer : public EmptyWebMediaPlayer { | 39 class MockVideoWebMediaPlayer : public EmptyWebMediaPlayer { |
40 public: | 40 public: |
41 bool hasVideo() const override { return true; } | 41 bool hasVideo() const override { return true; } |
42 | 42 |
43 MOCK_CONST_METHOD0(naturalSize, WebSize()); | 43 MOCK_CONST_METHOD0(naturalSize, WebSize()); |
44 }; | 44 }; |
45 | 45 |
46 class MockChromeClient : public EmptyChromeClient { | 46 class MockChromeClient : public EmptyChromeClient { |
47 public: | 47 public: |
| 48 void fullscreenElementChanged(Element* fromElement, |
| 49 Element* toElement) override { |
| 50 if (isHTMLVideoElement(toElement)) |
| 51 toHTMLVideoElement(toElement)->didEnterFullscreen(); |
| 52 if (isHTMLVideoElement(fromElement)) |
| 53 toHTMLVideoElement(fromElement)->didExitFullscreen(); |
| 54 } |
| 55 |
48 MOCK_CONST_METHOD0(screenInfo, WebScreenInfo()); | 56 MOCK_CONST_METHOD0(screenInfo, WebScreenInfo()); |
49 }; | 57 }; |
50 | 58 |
51 class StubLocalFrameClient : public EmptyLocalFrameClient { | 59 class StubLocalFrameClient : public EmptyLocalFrameClient { |
52 public: | 60 public: |
53 static StubLocalFrameClient* create() { return new StubLocalFrameClient; } | 61 static StubLocalFrameClient* create() { return new StubLocalFrameClient; } |
54 | 62 |
55 std::unique_ptr<WebMediaPlayer> createWebMediaPlayer( | 63 std::unique_ptr<WebMediaPlayer> createWebMediaPlayer( |
56 HTMLMediaElement&, | 64 HTMLMediaElement&, |
57 const WebMediaPlayerSource&, | 65 const WebMediaPlayerSource&, |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 EXPECT_EQ(WebScreenOrientationLockLandscape, computeOrientationLock()); | 398 EXPECT_EQ(WebScreenOrientationLockLandscape, computeOrientationLock()); |
391 | 399 |
392 screenInfo.orientationType = WebScreenOrientationLandscapeSecondary; | 400 screenInfo.orientationType = WebScreenOrientationLandscapeSecondary; |
393 EXPECT_CALL(chromeClient(), screenInfo()) | 401 EXPECT_CALL(chromeClient(), screenInfo()) |
394 .Times(1) | 402 .Times(1) |
395 .WillOnce(Return(screenInfo)); | 403 .WillOnce(Return(screenInfo)); |
396 EXPECT_EQ(WebScreenOrientationLockLandscape, computeOrientationLock()); | 404 EXPECT_EQ(WebScreenOrientationLockLandscape, computeOrientationLock()); |
397 } | 405 } |
398 | 406 |
399 } // namespace blink | 407 } // namespace blink |
OLD | NEW |