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

Unified Diff: chrome/browser/media/encrypted_media_supported_types_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: more fix 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_supported_types_browsertest.cc
diff --git a/chrome/browser/media/encrypted_media_supported_types_browsertest.cc b/chrome/browser/media/encrypted_media_supported_types_browsertest.cc
index d59b992c287152badac32325c56cfa9350521b7c..139105278d5f861af31681b3587b98845cd1e05c 100644
--- a/chrome/browser/media/encrypted_media_supported_types_browsertest.cc
+++ b/chrome/browser/media/encrypted_media_supported_types_browsertest.cc
@@ -83,8 +83,8 @@ const char kUnexpectedResult[] = "unexpected result";
// Expectations for Widevine.
// Note: Widevine is not available on platforms using components because
// RegisterPepperCdm() cannot set the codecs.
-// TODO(ddorwin): Enable these tests after we have the ability to use the CUS
-// in these tests. See http://crbug.com/356833.
+// TODO(xhwang): Enable these tests after we have the ability to use the
+// manifest in these tests. See http://crbug.com/586634
#if defined(WIDEVINE_CDM_AVAILABLE) && !defined(WIDEVINE_CDM_IS_COMPONENT)
#define EXPECT_WV_SUCCESS EXPECT_SUCCESS
#define EXPECT_WV_PROPRIETARY EXPECT_PROPRIETARY
@@ -96,6 +96,23 @@ const char kUnexpectedResult[] = "unexpected result";
#endif // defined(WIDEVINE_CDM_AVAILABLE) &&
// !defined(WIDEVINE_CDM_IS_COMPONENT)
+#if defined(ENABLE_PEPPER_CDMS)
+// Base path for Clear Key CDM (relative to the chrome executable).
+const char kClearKeyCdmBaseDirectory[] = "ClearKeyCdm";
+
+// Platform-specific filename relative to kClearKeyCdmBaseDirectory.
+const char kClearKeyCdmAdapterFileName[] =
+#if defined(OS_MACOSX)
+ "clearkeycdmadapter.plugin";
+#elif defined(OS_WIN)
+ "clearkeycdmadapter.dll";
+#elif defined(OS_POSIX)
+ "libclearkeycdmadapter.so";
+#endif
+
+const char kClearKeyCdmPluginMimeType[] = "application/x-ppapi-clearkey-cdm";
+#endif // defined(ENABLE_PEPPER_CDMS)
+
}; // namespace
class EncryptedMediaSupportedTypesTest : public InProcessBrowserTest {
@@ -150,6 +167,7 @@ class EncryptedMediaSupportedTypesTest : public InProcessBrowserTest {
// Update the command line to load |adapter_name| for
// |pepper_type_for_key_system|.
void RegisterPepperCdm(base::CommandLine* command_line,
+ const std::string& adapter_base_dir,
const std::string& adapter_name,
const std::string& pepper_type_for_key_system,
bool expect_adapter_exists = true) {
@@ -160,6 +178,8 @@ class EncryptedMediaSupportedTypesTest : public InProcessBrowserTest {
// Append the switch to register the appropriate adapter.
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_EQ(expect_adapter_exists, base::PathExists(plugin_lib));
base::FilePath::StringType pepper_plugin = plugin_lib.value();
@@ -282,26 +302,15 @@ class EncryptedMediaSupportedTypesExternalClearKeyTest
protected:
void SetUpCommandLine(base::CommandLine* command_line) override {
EncryptedMediaSupportedTypesTest::SetUpCommandLine(command_line);
-
- // Platform-specific filename relative to the chrome executable.
- const char adapter_file_name[] =
-#if defined(OS_MACOSX)
- "clearkeycdmadapter.plugin";
-#elif defined(OS_WIN)
- "clearkeycdmadapter.dll";
-#elif defined(OS_POSIX)
- "libclearkeycdmadapter.so";
-#endif
-
- const std::string pepper_name("application/x-ppapi-clearkey-cdm");
- RegisterPepperCdm(command_line, adapter_file_name, pepper_name);
+ RegisterPepperCdm(command_line, kClearKeyCdmBaseDirectory,
+ kClearKeyCdmAdapterFileName, kClearKeyCdmPluginMimeType);
}
#endif // defined(ENABLE_PEPPER_CDMS)
};
// TODO(sandersd): Register the Widevine CDM if it is a component. A component
// CDM registered using RegisterPepperCdm() declares support for audio codecs,
-// but not the other codecs we expect. http://crbug.com/356833.
+// but not the other codecs we expect. http://crbug.com/586634
ddorwin 2016/05/12 20:59:53 The old bug provides information about the problem
xhwang 2016/05/13 16:44:12 I am not sure. Reverted this change and we'll revi
class EncryptedMediaSupportedTypesWidevineTest
: public EncryptedMediaSupportedTypesTest {
};
@@ -313,10 +322,9 @@ class EncryptedMediaSupportedTypesClearKeyCDMRegisteredWithWrongPathTest
protected:
void SetUpCommandLine(base::CommandLine* command_line) override {
EncryptedMediaSupportedTypesTest::SetUpCommandLine(command_line);
- RegisterPepperCdm(command_line,
+ RegisterPepperCdm(command_line, kClearKeyCdmBaseDirectory,
"clearkeycdmadapterwrongname.dll",
- "application/x-ppapi-clearkey-cdm",
- false);
+ kClearKeyCdmPluginMimeType, false);
}
};
@@ -326,10 +334,9 @@ class EncryptedMediaSupportedTypesWidevineCDMRegisteredWithWrongPathTest
protected:
void SetUpCommandLine(base::CommandLine* command_line) override {
EncryptedMediaSupportedTypesTest::SetUpCommandLine(command_line);
- RegisterPepperCdm(command_line,
+ RegisterPepperCdm(command_line, "WidevineCdm",
"widevinecdmadapterwrongname.dll",
- "application/x-ppapi-widevine-cdm",
- false);
+ "application/x-ppapi-widevine-cdm", false);
}
};
#endif // defined(ENABLE_PEPPER_CDMS)

Powered by Google App Engine
This is Rietveld 408576698