Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegateTest.cpp

Issue 2793273002: Use internal hooks for notifying fullscreen changes to media controls (Closed)
Patch Set: update more tests Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698