Ignore MediaController in the muted/volume controls logic

Using MediaControllerInterface for volume/muted was a half-finished job,
since RenderMediaControls only considered HTMLMediaElement, so the
controls didn't really work with a media controller present.

The new test revealed a bug caused by MediaControls::changedVolume() not
considering the muted state. Consolidate the muted/volume handling to an
updateVolume() function to fix the bug and make the test pass.

The unconditional updateVolume() in reset() means that the volume will
always be set when the controls are first created. This revealed that
the media-volume-slider-hit-test test was broken: clickSliderMiddle() is
called when the volume slider isn't visible, and the clicked coordinates
are actually (0, 0). The test still passed because the default value for
a range input element is apparently the midpoint. Rewrite the test to
verify that clicking the volume slider actually updates the volume.

BUG=357236
TEST=LayoutTests/media/controls-mute-with-controller.html
     LayoutTests/media/controls-volume-slider.html

Review URL: https://codereview.chromium.org/217103004

git-svn-id: svn://svn.chromium.org/blink/trunk@170414 bbb929c8-8fbe-4397-9dbb-9b2b20218538
14 files changed
tree: 17acfab2a21c684690abceae01547e581a6bcb02
  1. third_party/