Bug 147493 - Media Session: add test to ensure that switching media sessions pauses elements
Summary: Media Session: add test to ensure that switching media sessions pauses elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 145411
  Show dependency treegraph
 
Reported: 2015-07-31 11:09 PDT by Matt Rajca
Modified: 2015-07-31 22:34 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.75 KB, patch)
2015-07-31 11:11 PDT, Matt Rajca
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Rajca 2015-07-31 11:09:34 PDT
When switching media sessions, elements belonging to the old session should be paused.
Comment 1 Matt Rajca 2015-07-31 11:11:08 PDT
Created attachment 257933 [details]
Patch
Comment 2 Eric Carlson 2015-07-31 11:19:22 PDT
Comment on attachment 257933 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=257933&action=review

> LayoutTests/media/session/switching-sessions.html:37
> +            run('video.session = new MediaSession("transient")');
> +
> +            testExpected('video.paused', true);
> +
> +            endTest();

It might be good to register a 'pause' event handler and call endTest from there.
Comment 3 Matt Rajca 2015-07-31 22:24:56 PDT
(In reply to comment #2)
> Comment on attachment 257933 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=257933&action=review
> 
> > LayoutTests/media/session/switching-sessions.html:37
> > +            run('video.session = new MediaSession("transient")');
> > +
> > +            testExpected('video.paused', true);
> > +
> > +            endTest();
> 
> It might be good to register a 'pause' event handler and call endTest from
> there.

In the case where a media element is not paused, this will be faster than letting the test time out while waiting for an event to fire. I think I'll keep this.
Comment 4 Matt Rajca 2015-07-31 22:34:47 PDT
Committed r187710: <http://trac.webkit.org/changeset/187710>