Changeset 187256 in webkit


Ignore:
Timestamp:
Jul 23, 2015 3:02:07 PM (9 years ago)
Author:
mrajca@apple.com
Message:

Media Session: add infrastructure for testing ducking https://bugs.webkit.org/show_bug.cgi?id=147080

Reviewed by Jer Noble.

We need to expose a media element's underlying media player's volume to tests so we can test ducking.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::playerVolume):

  • html/HTMLMediaElement.h:
  • testing/Internals.cpp:

(WebCore::Internals::mediaElementPlayerVolume):

  • testing/Internals.h:
  • testing/Internals.idl:
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r187251 r187256  
     12015-07-23  Matt Rajca  <mrajca@apple.com>
     2
     3        Media Session: add infrastructure for testing ducking https://bugs.webkit.org/show_bug.cgi?id=147080
     4
     5        Reviewed by Jer Noble.
     6
     7        We need to expose a media element's underlying media player's volume to tests so we can test ducking.
     8
     9        * html/HTMLMediaElement.cpp:
     10        (WebCore::HTMLMediaElement::playerVolume):
     11        * html/HTMLMediaElement.h:
     12        * testing/Internals.cpp:
     13        (WebCore::Internals::mediaElementPlayerVolume):
     14        * testing/Internals.h:
     15        * testing/Internals.idl:
     16
    1172015-07-21  Jer Noble  <jer.noble@apple.com>
    218
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r187251 r187256  
    64806480
    64816481#if ENABLE(MEDIA_SESSION)
     6482double HTMLMediaElement::playerVolume() const
     6483{
     6484    return m_player ? m_player->volume() : 0;
     6485}
    64826486
    64836487MediaSession* HTMLMediaElement::session() const
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r187251 r187256  
    421421
    422422#if ENABLE(MEDIA_SESSION)
     423    WEBCORE_EXPORT double playerVolume() const;
     424
    423425    const String& kind() const { return m_kind; }
    424426    void setKind(const String& kind) { m_kind = kind; }
  • trunk/Source/WebCore/testing/Internals.cpp

    r187120 r187256  
    28102810    }
    28112811}
     2812
     2813double Internals::mediaElementPlayerVolume(HTMLMediaElement* element) const
     2814{
     2815    ASSERT_ARG(element, element);
     2816    return element->playerVolume();
     2817}
    28122818#endif // ENABLE(MEDIA_SESSION)
    28132819
  • trunk/Source/WebCore/testing/Internals.h

    r187110 r187256  
    399399    void sendMediaSessionEndOfInterruptionNotification(const String&);
    400400    String mediaSessionCurrentState(MediaSession*) const;
     401    double mediaElementPlayerVolume(HTMLMediaElement*) const;
    401402#endif
    402403
  • trunk/Source/WebCore/testing/Internals.idl

    r187110 r187256  
    362362    [Conditional=MEDIA_SESSION] void sendMediaSessionEndOfInterruptionNotification(MediaSessionInterruptingCategory category);
    363363    [Conditional=MEDIA_SESSION] DOMString mediaSessionCurrentState(MediaSession session);
     364    [Conditional=MEDIA_SESSION] double mediaElementPlayerVolume(HTMLMediaElement element);
    364365    [Conditional=VIDEO] void applicationWillEnterForeground();
    365366    [Conditional=VIDEO] void applicationWillEnterBackground();
Note: See TracChangeset for help on using the changeset viewer.