From 3914953bffee7f4776c205c5b07d27ef23b41694 Mon Sep 17 00:00:00 2001 From: Jeff Tinker Date: Thu, 13 Apr 2017 23:57:16 -0700 Subject: [PATCH] Add an offline test asset for the drm vts test To test restoreKeys, a content configuration with a license policy allowing offline playaback was needed. Test: drm vts test bug:34178477 Change-Id: Ib90d7a878c0f310569abb09f21138c7a6ac9daae --- .../vts/vendor_module/vts_module.cpp | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/libwvdrmengine/vts/vendor_module/vts_module.cpp b/libwvdrmengine/vts/vendor_module/vts_module.cpp index e06b5d67..16d89eec 100644 --- a/libwvdrmengine/vts/vendor_module/vts_module.cpp +++ b/libwvdrmengine/vts/vendor_module/vts_module.cpp @@ -87,6 +87,8 @@ namespace widevine_vts { WidevineVTSVendorModule_V1::getContentConfigurations() const { vector configurations; + + // Content Configuration #1 { const string serverUrl = "http://widevine-proxy.appspot.com/proxy"; const vector initData = a2b_hex( @@ -109,15 +111,51 @@ namespace widevine_vts { }; ContentConfiguration config = { - .name = "UAT-asset1", + .name = "streaming_clip1", .serverUrl = serverUrl, .initData = initData, .mimeType = "cenc", .optionalParameters = map(), + .policy.allowOffline = false, + .keys = keys + }; + configurations.push_back(config); + } + + // Content Configuration #2 - Allows offline playback + { + const string serverUrl = "http://widevine-proxy.appspot.com/proxy"; + const vector initData = a2b_hex( + "00000040" // blob size + "70737368" // "pssh" + "00000000" // flags + "edef8ba979d64acea3c827dcd51d21ed" // Widevine system id + "00000020" // pssh data size + "08011a0d7769646576696e655f746573" // pssh data... + "74220d6f66666c696e655f636c697033" + "7031"); + const vector keyId = a2b_hex("3260f39e12ccf653529990168a3583ff"); + const vector keyValue = a2b_hex("8040c019929b2cc116a2e8dac739eafa"); + const vector keys = { + { + .isSecure = false, + .keyId = keyId, + .clearContentKey = keyValue + } + }; + + ContentConfiguration config = { + .name = "offline_clip3", + .serverUrl = serverUrl, + .initData = initData, + .mimeType = "cenc", + .optionalParameters = map(), + .policy.allowOffline = true, .keys = keys }; configurations.push_back(config); }; + return configurations; }