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

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp

Issue 2701433003: Hide overlay play button if it can't be shown without clipping (Closed)
Patch Set: Turn on overlay play button in layout test Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp
index 4382731a04b497a200cbc9f1f4505674a7107c99..27b337b2704cbac7f544427a08d94c83c5a03554 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp
@@ -163,10 +163,11 @@ class MediaControlsTest : public ::testing::Test {
WebRemotePlaybackAvailability::DeviceAvailable);
}
- void ensureLayout() {
- // Force a relayout, so that the controls know the width. Otherwise,
- // they don't know if, for example, the cast button will fit.
- m_mediaControls->mediaElement().clientWidth();
+ void ensureSizing() {
+ // Fire the size-change callback to ensure that the controls have
+ // been properly notified of the video size.
+ m_mediaControls->notifyElementSizeChanged(
+ m_mediaControls->mediaElement().getBoundingClientRect());
}
void simulateHideMediaControlsTimerFired() {
@@ -241,7 +242,7 @@ TEST_F(MediaControlsTest, ResetDoesNotTriggerInitialLayout) {
}
TEST_F(MediaControlsTest, CastButtonRequiresRoute) {
- ensureLayout();
+ ensureSizing();
mediaControls().mediaElement().setBooleanAttribute(HTMLNames::controlsAttr,
true);
@@ -256,7 +257,7 @@ TEST_F(MediaControlsTest, CastButtonRequiresRoute) {
}
TEST_F(MediaControlsTest, CastButtonDisableRemotePlaybackAttr) {
- ensureLayout();
+ ensureSizing();
mediaControls().mediaElement().setBooleanAttribute(HTMLNames::controlsAttr,
true);
@@ -343,7 +344,7 @@ TEST_F(MediaControlsTest, KeepControlsVisibleIfOverflowListVisible) {
}
TEST_F(MediaControlsTest, DownloadButtonDisplayed) {
- ensureLayout();
+ ensureSizing();
Element* downloadButton = getElementByShadowPseudoId(
mediaControls(), "-internal-media-controls-download-button");
@@ -358,7 +359,7 @@ TEST_F(MediaControlsTest, DownloadButtonDisplayed) {
}
TEST_F(MediaControlsTest, DownloadButtonNotDisplayedEmptyUrl) {
- ensureLayout();
+ ensureSizing();
Element* downloadButton = getElementByShadowPseudoId(
mediaControls(), "-internal-media-controls-download-button");
@@ -372,7 +373,7 @@ TEST_F(MediaControlsTest, DownloadButtonNotDisplayedEmptyUrl) {
}
TEST_F(MediaControlsTest, DownloadButtonNotDisplayedInfiniteDuration) {
- ensureLayout();
+ ensureSizing();
Element* downloadButton = getElementByShadowPseudoId(
mediaControls(), "-internal-media-controls-download-button");
@@ -389,7 +390,7 @@ TEST_F(MediaControlsTest, DownloadButtonNotDisplayedInfiniteDuration) {
}
TEST_F(MediaControlsTest, DownloadButtonNotDisplayedHLS) {
- ensureLayout();
+ ensureSizing();
Element* downloadButton = getElementByShadowPseudoId(
mediaControls(), "-internal-media-controls-download-button");
@@ -403,7 +404,7 @@ TEST_F(MediaControlsTest, DownloadButtonNotDisplayedHLS) {
}
TEST_F(MediaControlsTest, TimelineSeekToRoundedEnd) {
- ensureLayout();
+ ensureSizing();
MediaControlTimelineElement* timeline =
static_cast<MediaControlTimelineElement*>(getElementByShadowPseudoId(

Powered by Google App Engine
This is Rietveld 408576698