<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:eric.carlson@apple.com" title="Eric Carlson <eric.carlson@apple.com>"> <span class="fn">Eric Carlson</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - Media Session: test Next/Previous Track media control events delivered to Content media sessions"
href="https://bugs.webkit.org/show_bug.cgi?id=147416">bug 147416</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #257777 Flags</td>
<td>review?
</td>
<td>review+
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Media Session: test Next/Previous Track media control events delivered to Content media sessions"
href="https://bugs.webkit.org/show_bug.cgi?id=147416#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Media Session: test Next/Previous Track media control events delivered to Content media sessions"
href="https://bugs.webkit.org/show_bug.cgi?id=147416">bug 147416</a>
from <span class="vcard"><a class="email" href="mailto:eric.carlson@apple.com" title="Eric Carlson <eric.carlson@apple.com>"> <span class="fn">Eric Carlson</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=257777&action=diff" name="attach_257777" title="Patch">attachment 257777</a> <a href="attachment.cgi?id=257777&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=257777&action=review">https://bugs.webkit.org/attachment.cgi?id=257777&action=review</a>
<span class="quote">> LayoutTests/media/session/track-media-events-in-content-sessions.html:16
> + controls.addEventListener("nexttrack", skipToNextTrack, false);
> + controls.addEventListener("previoustrack", skipToPreviousTrack, false);</span >
Nit: in case you don't know you can use waitForEvent on any object to get the automatic logging it adds. For example:
waitForEvent('nexttrack', skipToNextTrack, false, false, controls)
<span class="quote">> LayoutTests/media/session/track-media-events-in-content-sessions.html:30
> + function beginPlaying(event)
> + {
> + if (window.internals)
> + testExpected('internals.mediaSessionCurrentState(session)', "idle");
> +
> + testExpected('video.paused', true);</span >
Nit: If you want to add the event listener with "video.onplaying", I think it will make the test results easier to understand if you log the event name as you would if you used waitForEvent, eg:
consoleWrite("EVENT(" + event.type + ")");
<span class="quote">> LayoutTests/media/session/track-media-events-in-content-sessions.html:33
> + consoleWrite("Playing media.");
> + video.play();</span >
Nit: "Begin playing media" would be more correct. Alternatively you could use "run('video.play()')" instead.
<span class="quote">> LayoutTests/media/session/track-media-events-in-content-sessions.html:38
> + video.onplaying = null;</span >
Nit: "waitForEvent('playing', beganPlaying, false, true)" would make this unnecessary.
<span class="quote">> LayoutTests/media/session/track-media-events-in-content-sessions.html:43
> + consoleWrite("Active Media Sessions should respond to Previous/Next Track events.");</span >
Nit: This is essentially the same as the paragraph in the body so I don't think it is necessary.
<span class="quote">> LayoutTests/media/session/track-media-events-in-content-sessions.html:57
> + function skipToNextTrack(event)
> + {
> + consoleWrite("Sending Previous Track media event.");
> + run('internals.sendMediaControlEvent("previous-track")');
> + }</span >
Nit: If you want to add the event listener with addEventListener(), I think it will make the test results easier to understand if you log the event name as you would if you used waitForEvent, eg:
consoleWrite("EVENT(" + event.type + ")");
<span class="quote">> LayoutTests/media/session/track-media-events-in-content-sessions.html:62
> + function skipToPreviousTrack(event)
> + {
> + endTest();
> + }</span >
Ditto.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>