Commit 119e34c6 authored by wdzierzanowski's avatar wdzierzanowski Committed by Commit bot

Bundle fake Widevine component manifest for stub CDM

Encrypted media browser tests involving Widevine use the stub CDM when
branding != Chrome.  This change allows them to register the
preinstalled component containing the stub CDM.

BUG=622273

TEST=Widevine browser tests 'browser_tests --gtest_filter=*Widevine*' pass

Review-Url: https://codereview.chromium.org/2136983002
Cr-Commit-Position: refs/heads/master@{#414706}
parent 16c88dfc
......@@ -14,6 +14,7 @@ import("//build/config/win/manifest.gni")
import("//chrome/chrome_repack_locales.gni")
import("//chrome/common/features.gni")
import("//chrome/version.gni")
import("//third_party/widevine/cdm/widevine.gni")
import("//ui/base/ui_features.gni")
import("//v8/gni/v8.gni")
......@@ -844,21 +845,42 @@ if (is_win) {
}
}
if (is_chrome_branded) {
_should_bundle_widevine =
(is_chrome_branded || enable_widevine) && enable_pepper_cdms
if (_should_bundle_widevine) {
# The Widevine CDM and manifest are either the actual Widevine CDM and
# manifest or stubs used for testing only. The choice is made within the
# corresponding Widevine targets based on branding.
bundle_data("widevine_cdm_library_binaries") {
sources = [
"$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib",
"$root_out_dir/libwidevinecdm.dylib",
"$root_out_dir/$widevine_cdm_path/widevinecdmadapter.plugin",
]
outputs = [
"{{bundle_root_dir}}/Libraries/$widevine_cdm_path/{{source_file_part}}",
]
public_deps = [
"//third_party/widevine/cdm:widevinecdm",
# Need this intermediate dependency because "widevinecdm" is a
# shared_library if !is_chrome_branded, and then depending on
# "widevinecdm" directly would cause it to be linked into the Chromium
# Framework, which we don't want.
":widevine_cdm_library_copy",
"//third_party/widevine/cdm:widevinecdmadapter",
]
}
copy("widevine_cdm_library_copy") {
sources = [
"$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib",
]
outputs = [
"$root_out_dir/{{source_file_part}}",
]
deps = [
"//third_party/widevine/cdm:widevinecdm",
]
}
bundle_data("widevine_cdm_library_manifest") {
sources = [
"$root_out_dir/WidevineCdm/manifest.json",
......@@ -873,7 +895,7 @@ if (is_win) {
}
group("widevine_cdm_library") {
if (is_chrome_branded) {
if (_should_bundle_widevine) {
deps = [
":widevine_cdm_library_binaries",
":widevine_cdm_library_manifest",
......
......@@ -45,6 +45,7 @@ if (is_android) {
}
} else if (enable_widevine) {
widevine_cdm_version_h_file = "stub/widevine_cdm_version.h"
widevine_cdm_manifest_file = [ "stub/manifest.json" ]
} else {
# No branding, use the default one.
widevine_cdm_version_h_file = "widevine_cdm_version.h"
......
{
"manifest_version": 2,
"name": "WidevineCdm",
"description": "Widevine Content Decryption Module Stub",
"offline_enabled": false,
"version": "0.0.0.000",
"minimum_chrome_version": "54.0.0.0",
"x-cdm-module-versions": "4",
"x-cdm-interface-versions": "8",
"x-cdm-host-versions": "8",
"x-cdm-codecs": "vp8,vp9.0,avc1",
"platforms": [
{
"os": "win",
"arch": "x86",
"sub_package_path": "_platform_specific/win_x86/"
},
{
"os": "win",
"arch": "x64",
"sub_package_path": "_platform_specific/win_x64/"
},
{
"os": "mac",
"arch": "x64",
"sub_package_path": "_platform_specific/mac_x64/"
}
]
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment