OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 if (final_title == kFailed) { | 57 if (final_title == kFailed) { |
58 std::string fail_message; | 58 std::string fail_message; |
59 EXPECT_TRUE(content::ExecuteJavaScriptAndExtractString( | 59 EXPECT_TRUE(content::ExecuteJavaScriptAndExtractString( |
60 shell()->web_contents()->GetRenderViewHost(), L"", | 60 shell()->web_contents()->GetRenderViewHost(), L"", |
61 L"window.domAutomationController.send(failMessage);", &fail_message)); | 61 L"window.domAutomationController.send(failMessage);", &fail_message)); |
62 LOG(INFO) << "Test failed: " << fail_message; | 62 LOG(INFO) << "Test failed: " << fail_message; |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 protected: | 66 protected: |
67 // Registers all necessary CDM plugins. | 67 // Registers any CDM plugins not registered by default. |
68 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 68 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
69 command_line->AppendSwitch(switches::kDisableAudio); | 69 command_line->AppendSwitch(switches::kDisableAudio); |
70 command_line->AppendSwitch(switches::kEnableEncryptedMedia); | 70 command_line->AppendSwitch(switches::kEnableEncryptedMedia); |
| 71 command_line->AppendSwitch(switches::kPpapiOutOfProcess); |
71 | 72 |
72 // Append the switch to register the clearkeycdm plugin. | 73 // Append the switch to register the Clear Key CDM plugin. |
73 // library name = <out dir>/<test_name>.<library_extension> | |
74 // MIME type = application/x-ppapi-clearkey-cdm | |
75 FilePath plugin_dir; | 74 FilePath plugin_dir; |
76 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir)); | 75 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir)); |
77 FilePath plugin_lib = plugin_dir.Append(kLibraryName); | 76 FilePath plugin_lib = plugin_dir.Append(kLibraryName); |
78 EXPECT_TRUE(file_util::PathExists(plugin_lib)); | 77 EXPECT_TRUE(file_util::PathExists(plugin_lib)); |
79 FilePath::StringType pepper_plugin = plugin_lib.value(); | 78 FilePath::StringType pepper_plugin = plugin_lib.value(); |
80 pepper_plugin.append(FILE_PATH_LITERAL( | 79 pepper_plugin.append(FILE_PATH_LITERAL( |
81 "#ClearKey CDM#ClearKey CDM 0.1.0.0#0.1.0.0;")); | 80 "#Clear Key CDM#Clear Key CDM 0.1.0.0#0.1.0.0;")); |
82 #if defined(OS_WIN) | 81 #if defined(OS_WIN) |
83 pepper_plugin.append(ASCIIToWide( | 82 pepper_plugin.append(ASCIIToWide( |
84 webkit_media::GetPluginType(kExternalClearKeyKeySystem))); | 83 webkit_media::GetPluginType(kExternalClearKeyKeySystem))); |
85 #else | 84 #else |
86 pepper_plugin.append( | 85 pepper_plugin.append( |
87 webkit_media::GetPluginType(kExternalClearKeyKeySystem)); | 86 webkit_media::GetPluginType(kExternalClearKeyKeySystem)); |
88 #endif | 87 #endif |
89 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, | 88 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, |
90 pepper_plugin); | 89 pepper_plugin); |
91 } | 90 } |
92 }; | 91 }; |
93 | 92 |
94 // Fails on Linux/ChromeOS with ASan. http://crbug.com/153231 | 93 // Fails on Linux/ChromeOS with ASan. http://crbug.com/153231 |
95 #if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ADDRESS_SANITIZER) | 94 #if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(ADDRESS_SANITIZER) |
96 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, DISABLED_BasicPlayback) { | 95 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, DISABLED_BasicPlayback) { |
97 const string16 kExpected = ASCIIToUTF16("ENDED"); | 96 const string16 kExpected = ASCIIToUTF16("ENDED"); |
98 ASSERT_NO_FATAL_FAILURE(PlayMedia(GetParam(), kExpected)); | 97 ASSERT_NO_FATAL_FAILURE(PlayMedia(GetParam(), kExpected)); |
(...skipping 12 matching lines...) Expand all Loading... |
111 } | 110 } |
112 | 111 |
113 INSTANTIATE_TEST_CASE_P(ClearKey, EncryptedMediaTest, | 112 INSTANTIATE_TEST_CASE_P(ClearKey, EncryptedMediaTest, |
114 ::testing::Values(kClearKeyKeySystem)); | 113 ::testing::Values(kClearKeyKeySystem)); |
115 | 114 |
116 // http://crbug.com/152864 | 115 // http://crbug.com/152864 |
117 #if !defined(OS_MACOSX) | 116 #if !defined(OS_MACOSX) |
118 INSTANTIATE_TEST_CASE_P(ExternalClearKey, EncryptedMediaTest, | 117 INSTANTIATE_TEST_CASE_P(ExternalClearKey, EncryptedMediaTest, |
119 ::testing::Values(kExternalClearKeyKeySystem)); | 118 ::testing::Values(kExternalClearKeyKeySystem)); |
120 #endif | 119 #endif |
OLD | NEW |