<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <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#c4">Comment # 4</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:mrajca&#64;apple.com" title="Matt Rajca &lt;mrajca&#64;apple.com&gt;"> <span class="fn">Matt Rajca</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=147416#c3">comment #3</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=257777&amp;action=diff" name="attach_257777" title="Patch">attachment 257777</a> <a href="attachment.cgi?id=257777&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=257777&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=257777&amp;action=review</a>
&gt; 
&gt; &gt; LayoutTests/media/session/track-media-events-in-content-sessions.html:16
&gt; &gt; +            controls.addEventListener(&quot;nexttrack&quot;, skipToNextTrack, false);
&gt; &gt; +            controls.addEventListener(&quot;previoustrack&quot;, skipToPreviousTrack, false);
&gt; 
&gt; Nit: in case you don't know you can use waitForEvent on any object to get
&gt; the automatic logging it adds. For example:
&gt; 
&gt; waitForEvent('nexttrack', skipToNextTrack, false, false, controls)</span >

I switched to `waitForEvent`.

<span class="quote">&gt; 
&gt; &gt; LayoutTests/media/session/track-media-events-in-content-sessions.html:30
&gt; &gt; +        function beginPlaying(event)
&gt; &gt; +        {
&gt; &gt; +            if (window.internals)
&gt; &gt; +                testExpected('internals.mediaSessionCurrentState(session)', &quot;idle&quot;);
&gt; &gt; +
&gt; &gt; +            testExpected('video.paused', true);
&gt; 
&gt; Nit: If you want to add the event listener with &quot;video.onplaying&quot;, I think
&gt; it will make the test results easier to understand if you log the event name
&gt; as you would if you used waitForEvent, eg:
&gt; 
&gt; consoleWrite(&quot;EVENT(&quot; + event.type + &quot;)&quot;);</span >


Switched to `waitForEvent`.

<span class="quote">&gt; 
&gt; &gt; LayoutTests/media/session/track-media-events-in-content-sessions.html:33
&gt; &gt; +            consoleWrite(&quot;Playing media.&quot;);
&gt; &gt; +            video.play();
&gt; 
&gt; Nit: &quot;Begin playing media&quot; would be more correct.</span >

Fixed.

<span class="quote">&gt; Alternatively you could use &quot;run('video.play()')&quot; instead.
&gt; 
&gt; &gt; LayoutTests/media/session/track-media-events-in-content-sessions.html:38
&gt; &gt; +            video.onplaying = null;
&gt; 
&gt; Nit: &quot;waitForEvent('playing', beganPlaying, false, true)&quot; would make this
&gt; unnecessary.</span >

Switched for `waitForEvent`.

<span class="quote">&gt; 
&gt; &gt; LayoutTests/media/session/track-media-events-in-content-sessions.html:43
&gt; &gt; +            consoleWrite(&quot;Active Media Sessions should respond to Previous/Next Track events.&quot;);
&gt; 
&gt; Nit: This is essentially the same as the paragraph in the body so I don't
&gt; think it is necessary.</span >

Removed.

<span class="quote">&gt; 
&gt; &gt; LayoutTests/media/session/track-media-events-in-content-sessions.html:57
&gt; &gt; +        function skipToNextTrack(event)
&gt; &gt; +        {
&gt; &gt; +            consoleWrite(&quot;Sending Previous Track media event.&quot;);
&gt; &gt; +            run('internals.sendMediaControlEvent(&quot;previous-track&quot;)');
&gt; &gt; +        }
&gt; 
&gt; Nit: If you want to add the event listener with addEventListener(), I think
&gt; it will make the test results easier to understand if you log the event name
&gt; as you would if you used waitForEvent, eg:
&gt; 
&gt; consoleWrite(&quot;EVENT(&quot; + event.type + &quot;)&quot;);</span >

Switched to `waitForEvent`.

<span class="quote">&gt; 
&gt; &gt; LayoutTests/media/session/track-media-events-in-content-sessions.html:62
&gt; &gt; +        function skipToPreviousTrack(event)
&gt; &gt; +        {
&gt; &gt; +            endTest();
&gt; &gt; +        }
&gt; 
&gt; Ditto.</span >

Switched to `waitForEvent`.</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>