<!DOCTYPE html>
<html>
    <head>
        <title>MediaKeys</title>
        <script src=../video-test.js></script>
        <script>
            function stringToUint8Array(str)
            {
                var arr=[];
                for(var i=0,j=str.length;i<j;++i)
                  arr[i]=str.charCodeAt(i);
                return new Uint8Array(arr);
            }

            var mediaKeys;
            var mediaKeySession;
            var initData = stringToUint8Array('mock');
            var invalidKey = stringToUint8Array('invalid');
            var validKey = stringToUint8Array(
                '{"keys":[{"kty":"oct","kid":"AAECAw==","k":"MTIzNDU2Nzg5MGFiY2RlZg=="}]}');

            function runTest() 
            {
                run('mediaKeys = new MediaKeys("org.w3.clearkey")');
                run('mediaKeySession = mediaKeys.createSession("video/webm", initData)');
                waitForEvent('webkitkeymessage', keyMessage, false, false, mediaKeySession);
                waitForEvent('webkitkeyerror', keyError, false, false, mediaKeySession);
                waitForEvent('webkitkeyadded', null, true, false, mediaKeySession);
            }

            function keyMessage(event)
            {
                run('mediaKeySession.update(invalidKey)');
            }

            function keyError(event)
            {
                run('mediaKeySession.update(validKey)');
            }
        </script>
    </head>
    <body onload="runTest()">
        <p>This tests the events created by MediaKeys.</p>
    </body>
</html>
<!DOCTYPE html>
<html>
    <head>
        <title>MediaKeys</title>
        <script src=../video-test.js></script>
        <script>
            function stringToUint8Array(str)
            {
                var arr=[];
                for(var i=0,j=str.length;i<j;++i)
                  arr[i]=str.charCodeAt(i);
                return new Uint8Array(arr);
            }

            var mediaKeys;
            var mediaKeySession;
            var initData = stringToUint8Array('mock');
            var invalidKey = stringToUint8Array('invalid');
            var validKey = stringToUint8Array(
                '{"keys":[{"kty":"oct","kid":"AAECAw","k":"MTIzNDU2Nzg5MGFiY2RlZg"}]}');

            function runTest() 
            {
                run('mediaKeys = new MediaKeys("org.w3.clearkey")');
                run('mediaKeySession = mediaKeys.createSession("video/webm", initData)');
                waitForEvent('webkitkeymessage', keyMessage, false, false, mediaKeySession);
                waitForEvent('webkitkeyerror', keyError, false, false, mediaKeySession);
                waitForEvent('webkitkeyadded', null, true, false, mediaKeySession);
            }

            function keyMessage(event)
            {
                run('mediaKeySession.update(invalidKey)');
            }

            function keyError(event)
            {
                run('mediaKeySession.update(validKey)');
            }
        </script>
    </head>
    <body onload="runTest()">
        <p>This tests the events created by MediaKeys.</p>
    </body>
</html>
Remove base64 padding from EME tests
Remove base64 padding from EME tests

The EME spec now states that base64 padding should not be included, so update
the single EME layout test that uses JWK.

Change to padding made in https://codereview.chromium.org/27433002.

BUG=303381

Review URL: https://codereview.chromium.org/54203007

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@161183 bbb929c8-8fbe-4397-9dbb-9b2b20218538
