drm-expiration.https.html (2674B)
1 <!doctype html> 2 <html> 3 <head> 4 <meta charset=utf-8> 5 <meta name="timeout" content="long"> 6 <title>Encrypted Media Extensions: Expiration with DRM</title> 7 <link rel="help" href="https://w3c.github.io/encrypted-media/"> 8 9 <!-- Web Platform Test Harness scripts --> 10 <script src=/resources/testharness.js></script> 11 <script src=/resources/testharnessreport.js></script> 12 13 <!-- Helper scripts for Encrypted Media Extensions tests --> 14 <script src=/encrypted-media/util/utils.js></script> 15 <script src=/encrypted-media/util/utf8.js></script> 16 <script src=/encrypted-media/util/testmediasource.js></script> 17 18 <!-- Content metadata --> 19 <script src=/encrypted-media/content/content-metadata.js></script> 20 21 <!-- Message handler for DRM servers --> 22 <script src=/encrypted-media/util/drm-messagehandler.js></script> 23 24 <!-- The script for this specific test --> 25 <script src=/encrypted-media/scripts/expiration.js></script> 26 27 </head> 28 <body> 29 <div id='log'></div> 30 31 <script> 32 var keysystem = getSupportedKeySystem(); 33 34 getSupportedContentAndInitDataTypes( keysystem ).then( function( supported ) { 35 // This test requires initData for supported content. 36 // We prefer explicit initData configured for the content, but 37 // otherwise we will generate initData for a supported initDataType 38 // FIXME: Move me to a utility function 39 var content, 40 initDataType, 41 initData; 42 43 var contentWithExplicitInitData = supported.filter( function( s ) { return s.content.initDataType && s.content.keys; } ); 44 if ( contentWithExplicitInitData.length > 0 ) { 45 content = contentWithExplicitInitData[ 0 ].content; 46 initDataType = content.keys[ 0 ].initDataType; 47 initData = base64DecodeToUnit8Array( content.keys[ 0 ].initData ); 48 } else { 49 content = supported[ 0 ].content; 50 initDataType = supported[ 0 ].initDataTypes[ 0 ]; 51 initData = getInitData( content, initDataType ); 52 } 53 54 var handler = new MessageHandler( keysystem, content ); 55 56 runTest( { keysystem: keysystem, 57 content: content, 58 messagehandler: handler.messagehandler, 59 initDataType: initDataType, 60 initData: initData, 61 expiration: Date.now().valueOf() + 120000 // Two minutes from now 62 } ); 63 } ); 64 65 </script> 66 </body> 67 </html>