<!DOCTYPE html>
<html>
    <head>
        <title>test playbackRate and defaultPlaybackRate</title>
        <script src=media-file.js></script>
        <script src=video-test.js></script>
        <script>
            var rateChangeCount = 0;

            function ratechange()
            {
                consoleWrite("*** checking rates after event");
                switch (++rateChangeCount)
                {
                    case 1:
                        testExpected("video.playbackRate", 1);
                        testExpected("video.defaultPlaybackRate", 2);

                        consoleWrite("<br>*** setting playbackRate");
                        run("video.playbackRate = 2");
                        testExpected("video.playbackRate", 2);
                        testExpected("video.defaultPlaybackRate", 2);
                        consoleWrite("");
                        break;
                    case 2:
                        testExpected("video.playbackRate", 2);
                        testExpected("video.defaultPlaybackRate", 2);

                        consoleWrite("<br>*** beginning playback");
                        video.currentTime = video.duration - 0.2;
                        run("video.playbackRate = 1");
                        testExpected("video.playbackRate", 1);
                        testExpected("video.defaultPlaybackRate", 2);
                        run("video.play()");
                        consoleWrite("");
                        break;
                    case 3:
                        testExpected("video.playbackRate", 1);
                        testExpected("video.defaultPlaybackRate", 2);
                        consoleWrite("");
                        break;
                    default:
                        break;
                }
            }

            function canplaythrough()
            {
                consoleWrite("<br>*** checking defaults");
                testExpected("video.playbackRate", 1);
                testExpected("video.defaultPlaybackRate", 1);

                consoleWrite("<br>*** setting defaultPlaybackRate");
                run("video.defaultPlaybackRate = 2");
                testExpected("video.playbackRate", 1);
                testExpected("video.defaultPlaybackRate", 2);
                consoleWrite("");
            }

            function ended()
            {
                testExpected("video.playbackRate", 1);
                testExpected("video.defaultPlaybackRate", 2);
                consoleWrite("");

                consoleWrite("Test extreme playback rates");
                run("video.defaultPlaybackRate = Number.MIN_VALUE");
                testExpected("video.defaultPlaybackRate", Number.MIN_VALUE);
                consoleWrite("");

                run("video.defaultPlaybackRate = Number.MAX_VALUE");
                testExpected("video.defaultPlaybackRate", Number.MAX_VALUE);
                consoleWrite("");

                run("video.playbackRate = Number.MIN_VALUE");
                testExpected("video.playbackRate", Number.MIN_VALUE);
                consoleWrite("");

                run("video.playbackRate = Number.MAX_VALUE");
                testExpected("video.playbackRate", Number.MAX_VALUE);
                consoleWrite("");
                endTest();
            }

            function start()
            {
                findMediaElement();
                waitForEvent('canplaythrough', canplaythrough);
                waitForEvent('ended', ended);
                waitForEvent('ratechange', ratechange);

                consoleWrite("*** setting src");
                setSrcByTagName("video", findMediaFile("video", "content/test"));
            }

        </script>
    </head>

    <body onload="start()">
        
        <video controls > </video>
        <ol>
            <li>'playbackRate' should not change when play() is called.</li>
            <li>'playbackRate' and 'defaultPlaybackRate' should always return the last value set.</li>
        </ol>
    </body>
</html>
