Chromium Code Reviews| Index: content/browser/media/encrypted_media_browsertest.cc |
| diff --git a/content/browser/media/encrypted_media_browsertest.cc b/content/browser/media/encrypted_media_browsertest.cc |
| index 34cbd65376b1e122f5db385776bbcfbaad111d1f..eba93ba27d40994bce30dab70ee3e27a4f90cce9 100644 |
| --- a/content/browser/media/encrypted_media_browsertest.cc |
| +++ b/content/browser/media/encrypted_media_browsertest.cc |
| @@ -29,8 +29,8 @@ |
| // Platform-specific filename relative to the chrome executable. |
| #if defined(OS_WIN) |
| -static const char kClearKeyLibraryName[] = "clearkeycdmadapter.dll"; |
| -static const char kWidevineLibraryName[] = "widevinecdmadapter.dll"; |
| +static const wchar_t kClearKeyLibraryName[] = L"clearkeycdmadapter.dll"; |
| +static const wchar_t kWidevineLibraryName[] = L"widevinecdmadapter.dll"; |
| #elif defined(OS_MACOSX) |
| static const char kClearKeyLibraryName[] = "clearkeycdmadapter.plugin"; |
| static const char kWidevineLibraryName[] = "widevinecdmadapter.plugin"; |
| @@ -105,33 +105,30 @@ class EncryptedMediaTest : public testing::WithParamInterface<const char*>, |
| } |
| protected: |
| - // Registers any CDM plugins not registered by default. |
| virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| - RegisterPepperPlugin(command_line, kClearKeyLibraryName, |
| - kExternalClearKeyKeySystem); |
| + RegisterPepperCdm(command_line, kClearKeyLibraryName, |
|
xhwang
2013/05/10 00:26:44
what's the reason these pepper related code isn't
ddorwin
2013/05/14 00:17:10
We can handle compatibility with a single ifdef at
|
| + kExternalClearKeyKeySystem); |
| } |
| - virtual void RegisterPepperPlugin(CommandLine* command_line, |
| - const std::string& library_name, |
| - const std::string& key_system) { |
| + virtual void RegisterPepperCdm(CommandLine* command_line, |
| + const base::FilePath::StringType& library_name, |
| + const std::string& key_system) { |
| +#if defined(ENABLE_PEPPER_CDMS) |
| // Append the switch to register the Clear Key CDM Adapter. |
| base::FilePath plugin_dir; |
| EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir)); |
| -#if defined(OS_WIN) |
| - base::FilePath plugin_lib = plugin_dir.Append(ASCIIToWide(library_name)); |
| -#else |
| base::FilePath plugin_lib = plugin_dir.Append(library_name); |
| -#endif |
| EXPECT_TRUE(file_util::PathExists(plugin_lib)); |
| base::FilePath::StringType pepper_plugin = plugin_lib.value(); |
| pepper_plugin.append(FILE_PATH_LITERAL("#CDM#0.1.0.0;")); |
| #if defined(OS_WIN) |
| - pepper_plugin.append(ASCIIToWide(webkit_media::GetPluginType(key_system))); |
| + pepper_plugin.append(ASCIIToWide(webkit_media::GetPepperType(key_system))); |
| #else |
| - pepper_plugin.append(webkit_media::GetPluginType(key_system)); |
| + pepper_plugin.append(webkit_media::GetPepperType(key_system)); |
| #endif |
| command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, |
| pepper_plugin); |
| +#endif // defined(ENABLE_PEPPER_CDMS) |
| } |
| }; |
| @@ -165,11 +162,9 @@ class WVEncryptedMediaTest : public EncryptedMediaTest { |
| } |
| protected: |
| - // Registers any CDM plugins not registered by default. |
| virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| command_line->AppendSwitch(switches::kAllowFileAccessFromFiles); |
| - RegisterPepperPlugin(command_line, kWidevineLibraryName, |
| - kWidevineKeySystem); |
| + RegisterPepperCdm(command_line, kWidevineLibraryName, kWidevineKeySystem); |
| } |
| }; |
| #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| @@ -177,8 +172,11 @@ class WVEncryptedMediaTest : public EncryptedMediaTest { |
| INSTANTIATE_TEST_CASE_P(ClearKey, EncryptedMediaTest, |
| ::testing::Values(kClearKeyKeySystem)); |
| +// External Clear Key is currently only used on platforms that use Pepper CDMs. |
| +#if defined(ENABLE_PEPPER_CDMS) |
| INSTANTIATE_TEST_CASE_P(ExternalClearKey, EncryptedMediaTest, |
| ::testing::Values(kExternalClearKeyKeySystem)); |
| +#endif |
| IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, InvalidKeySystem) { |
| const string16 kExpected = ASCIIToUTF16( |