<!DOCTYPE html>
<html>
    <head>
        <script src="/resources/testharness.js"></script>
        <script src="/resources/testharnessreport.js"></script>
        <script src="mediasource-util.js"></script>
    </head>
    <body>
        <div id="log"></div>
        <script>

            mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData)
            {
                mediaElement.play();
                sourceBuffer.appendBuffer(mediaData);

                function delayedPlayHandler()
                {
                    internals.postRemoteControlCommand('beginseekingbackward');
                    test.done();
                }

                test.waitForExpectedEvents(function()
                {
                    test.waitForCurrentTimeChange(mediaElement, delayedPlayHandler);
                });
            }, 'Test playing then seeking back with remote control command.(PASS if no crash)');
        </script>
    </body>
</html>
