Commit 2ccd5c88 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Call base class RemovedFrom for MediaControlsImpl.

isConnected() bit was not correctly cleared because of this.

Bug: 878696
Change-Id: I09d69c94eb5f9c9f4694a6ff1a473a112c895c8d
Reviewed-on: https://chromium-review.googlesource.com/1194225Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587341}
parent 147e6b6a
...@@ -808,9 +808,11 @@ MediaControlsImpl::ControlsState MediaControlsImpl::State() const { ...@@ -808,9 +808,11 @@ MediaControlsImpl::ControlsState MediaControlsImpl::State() const {
return ControlsState::kStopped; return ControlsState::kStopped;
} }
void MediaControlsImpl::RemovedFrom(ContainerNode&) { void MediaControlsImpl::RemovedFrom(ContainerNode& insertion_point) {
DCHECK(!MediaElement().isConnected()); DCHECK(!MediaElement().isConnected());
HTMLDivElement::RemovedFrom(insertion_point);
// TODO(mlamouri): we hide show the controls instead of having // TODO(mlamouri): we hide show the controls instead of having
// HTMLMediaElement do it. // HTMLMediaElement do it.
......
...@@ -1336,6 +1336,12 @@ TEST_F(MediaControlsImplTest, CastOverlayShowsOnSomeEvents) { ...@@ -1336,6 +1336,12 @@ TEST_F(MediaControlsImplTest, CastOverlayShowsOnSomeEvents) {
} }
} }
TEST_F(MediaControlsImplTest, isConnected) {
EXPECT_TRUE(MediaControls().isConnected());
MediaControls().MediaElement().remove();
EXPECT_FALSE(MediaControls().isConnected());
}
class ModernMediaControlsImplTest : public MediaControlsImplTest { class ModernMediaControlsImplTest : public MediaControlsImplTest {
public: public:
void SetUp() override { void SetUp() override {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment