Revision 4038be686e4912ac1779f73f9fca8d9cbfbb1ec0 authored by Ovidio Henriquez on 07 March 2018, 21:13:41 UTC, committed by Blink WPT Bot on 08 March 2018, 10:10:32 UTC
This change refactors the Web Bluetooth test API to use the
DeviceUUIDs helper class defined in BluetoothDevice. Additionally,
this change finishes the implementation of SimulateGATTServicesChanged,
and as a result, tests are updated to set the next discovery response
before calling this interface.

BUG=719826

Change-Id: I0f986eb7afe6fbf7ebaa80ac4b633d46a027b80d
Reviewed-on: https://chromium-review.googlesource.com/939984
Commit-Queue: Ovidio Henriquez <odejesush@chromium.org>
Reviewed-by: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541577}
1 parent 08d063d
Raw File
drm-events.https.html
<!doctype html>
<html>
  <head>
    <meta charset=utf-8>
    <meta name="timeout" content="long">
    <title>Encrypted Media Extensions: Events with DRM</title>
    <link rel="help" href="https://w3c.github.io/encrypted-media/">

    <!-- Web Platform Test Harness scripts -->
    <script src=/resources/testharness.js></script>
    <script src=/resources/testharnessreport.js></script>

    <!-- Helper scripts for Encrypted Media Extensions tests  -->
    <script src=/encrypted-media/util/utils.js></script>
    <script src=/encrypted-media/util/utf8.js></script>
    <script src=/encrypted-media/util/fetch.js></script>
    <script src=/encrypted-media/util/testmediasource.js></script>

    <!-- Content metadata -->
    <script src=/encrypted-media/content/content-metadata.js></script>

    <!-- Message handler for DRM servers -->
    <script src=/encrypted-media/util/drm-messagehandler.js></script>

    <!-- The script for this specific test -->
    <script src=/encrypted-media/scripts/events.js></script>

  </head>
  <body>
    <div id='log'></div>

    <script>
        var keysystem = getSupportedKeySystem();

        getSupportedContentAndInitDataTypes( keysystem )
        .then( function( supported )
        {
            // This test requires initData for supported content.
            // We prefer explciit initData configured for the content, but
            // otherwise we will generate initData for a supported initDataType
            // FIXME: Move me to a utility function
            var content,
                initDataType,
                initData;

            var contentWithExplicitInitData = supported.filter( function( s ) { return s.content.keys && s.content.initDataType; } );
            if ( contentWithExplicitInitData.length > 0 )
            {
                content = contentWithExplicitInitData[ 0 ].content;
                initDataType = content.keys[ 0 ].initDataType;
                initData = base64DecodeToUnit8Array( content.keys[ 0 ].initData );
            }
            else
            {
                content = supported[ 0 ].content;
                initDataType = supported[ 0 ].initDataTypes[ 0 ];
                initData = getInitData( content, initDataType );
            }

            var handler = new MessageHandler( keysystem, content );

            runTest( {  keysystem:          keysystem,
                        content:            content,
                        messagehandler:     handler.messagehandler,
                        initDataType:       initDataType,
                        initData:           initData
                    } );
        } );

    </script>
  </body>
</html>
back to top