OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
15 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
16 #include "chrome/test/base/in_process_browser_test.h" | 16 #include "chrome/test/base/in_process_browser_test.h" |
17 #include "chrome/test/base/ui_test_utils.h" | 17 #include "chrome/test/base/ui_test_utils.h" |
18 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
19 #include "content/public/test/browser_test_utils.h" | 19 #include "content/public/test/browser_test_utils.h" |
| 20 #include "media/base/test_data_util.h" |
20 #include "url/gurl.h" | 21 #include "url/gurl.h" |
21 | 22 |
22 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 23 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
23 | 24 |
24 #if defined(OS_ANDROID) | 25 #if defined(OS_ANDROID) |
25 #error This file needs to be updated to run on Android. | 26 #error This file needs to be updated to run on Android. |
26 #endif | 27 #endif |
27 | 28 |
28 #if defined(USE_PROPRIETARY_CODECS) | 29 #if defined(USE_PROPRIETARY_CODECS) |
29 #define EXPECT_PROPRIETARY EXPECT_TRUE | 30 #define EXPECT_PROPRIETARY EXPECT_TRUE |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 pepper_plugin.append(pepper_type_for_key_system); | 218 pepper_plugin.append(pepper_type_for_key_system); |
218 #endif | 219 #endif |
219 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, | 220 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, |
220 pepper_plugin); | 221 pepper_plugin); |
221 } | 222 } |
222 | 223 |
223 void LoadTestPage() { | 224 void LoadTestPage() { |
224 // Load the test page needed. IsConcreteSupportedKeySystem() needs some | 225 // Load the test page needed. IsConcreteSupportedKeySystem() needs some |
225 // JavaScript and a video loaded in order to work. | 226 // JavaScript and a video loaded in order to work. |
226 if (!is_test_page_loaded_) { | 227 if (!is_test_page_loaded_) { |
227 ASSERT_TRUE(test_server()->Start()); | 228 scoped_ptr<net::SpawnedTestServer> http_test_server = |
228 GURL gurl = test_server()->GetURL( | 229 media::StartMediaHttpTestServer(); |
229 "files/media/test_key_system_instantiation.html"); | 230 GURL gurl = http_test_server->GetURL( |
| 231 "files/test_key_system_instantiation.html"); |
230 ui_test_utils::NavigateToURL(browser(), gurl); | 232 ui_test_utils::NavigateToURL(browser(), gurl); |
231 is_test_page_loaded_ = true; | 233 is_test_page_loaded_ = true; |
232 } | 234 } |
233 } | 235 } |
234 | 236 |
235 bool IsConcreteSupportedKeySystem(const std::string& key) { | 237 bool IsConcreteSupportedKeySystem(const std::string& key) { |
236 std::string command( | 238 std::string command( |
237 "window.domAutomationController.send(testKeySystemInstantiation('"); | 239 "window.domAutomationController.send(testKeySystemInstantiation('"); |
238 command.append(key); | 240 command.append(key); |
239 command.append("'));"); | 241 command.append("'));"); |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 EncryptedMediaIsTypeSupportedWidevineCDMRegisteredWithWrongPathTest, | 1133 EncryptedMediaIsTypeSupportedWidevineCDMRegisteredWithWrongPathTest, |
1132 PepperCDMsRegisteredButAdapterNotPresent) { | 1134 PepperCDMsRegisteredButAdapterNotPresent) { |
1133 EXPECT_FALSE(IsConcreteSupportedKeySystem(kWidevineAlpha)); | 1135 EXPECT_FALSE(IsConcreteSupportedKeySystem(kWidevineAlpha)); |
1134 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( | 1136 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
1135 "video/webm", no_codecs(), kWidevineAlpha)); | 1137 "video/webm", no_codecs(), kWidevineAlpha)); |
1136 } | 1138 } |
1137 #endif // !defined(WIDEVINE_CDM_AVAILABLE) || defined(WIDEVINE_CDM_IS_COMPONENT
) | 1139 #endif // !defined(WIDEVINE_CDM_AVAILABLE) || defined(WIDEVINE_CDM_IS_COMPONENT
) |
1138 #endif // defined(ENABLE_PEPPER_CDMS) | 1140 #endif // defined(ENABLE_PEPPER_CDMS) |
1139 | 1141 |
1140 } // namespace chrome | 1142 } // namespace chrome |
OLD | NEW |