Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1452)

Unified Diff: chrome/browser/media/encrypted_media_browsertest.cc

Issue 1957643002: media: Move widevine CDM targets to WidevineCdm folder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also update stub cdm. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/encrypted_media_browsertest.cc
diff --git a/chrome/browser/media/encrypted_media_browsertest.cc b/chrome/browser/media/encrypted_media_browsertest.cc
index ffcf3679b38704a526f169b07a87a241f5ba05c3..52ced619f79f1c8a82b4f2072b77f82adf28ade3 100644
--- a/chrome/browser/media/encrypted_media_browsertest.cc
+++ b/chrome/browser/media/encrypted_media_browsertest.cc
@@ -261,11 +261,13 @@ class EncryptedMediaTestBase : public MediaBrowserTest {
#if defined(ENABLE_PEPPER_CDMS)
if (IsExternalClearKey(key_system)) {
- RegisterPepperCdm(command_line, kClearKeyCdmAdapterFileName, key_system);
+ RegisterPepperCdm(command_line, "", kClearKeyCdmAdapterFileName,
+ key_system);
}
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT)
else if (IsWidevine(key_system)) { // NOLINT
- RegisterPepperCdm(command_line, kWidevineCdmAdapterFileName, key_system);
+ RegisterPepperCdm(command_line, kWidevineCdmBaseDirectory,
+ kWidevineCdmAdapterFileName, key_system);
}
#endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT)
#endif // defined(ENABLE_PEPPER_CDMS)
@@ -273,18 +275,26 @@ class EncryptedMediaTestBase : public MediaBrowserTest {
private:
#if defined(ENABLE_PEPPER_CDMS)
+ // The CDM adatper should be located in |adapter_base_dir| in DIR_MODULE. If
+ // |adapter_base_dir| is empty, then the adapter should be located in
+ // DIR_MODULE directly.
void RegisterPepperCdm(base::CommandLine* command_line,
+ const std::string& adapter_base_dir,
const std::string& adapter_name,
const std::string& key_system) {
DCHECK(!is_pepper_cdm_registered_)
<< "RegisterPepperCdm() can only be called once.";
is_pepper_cdm_registered_ = true;
- // Append the switch to register the Clear Key CDM Adapter.
+ // Build the CDM adapter path.
base::FilePath plugin_dir;
EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir));
+ plugin_dir = plugin_dir.AppendASCII(adapter_base_dir);
+
base::FilePath plugin_lib = plugin_dir.AppendASCII(adapter_name);
EXPECT_TRUE(base::PathExists(plugin_lib)) << plugin_lib.value();
+
+ // Build pepper plugin registration switch.
base::FilePath::StringType pepper_plugin = plugin_lib.value();
pepper_plugin.append(FILE_PATH_LITERAL("#CDM#0.1.0.0;"));
#if defined(OS_WIN)
@@ -292,6 +302,8 @@ class EncryptedMediaTestBase : public MediaBrowserTest {
#else
pepper_plugin.append(GetPepperType(key_system));
#endif
+
+ // Append the switch to register the CDM Adapter.
command_line->AppendSwitchNative(switches::kRegisterPepperPlugins,
pepper_plugin);
}

Powered by Google App Engine
This is Rietveld 408576698