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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 #else // !defined(OS_WIN) | 329 #else // !defined(OS_WIN) |
330 #if defined(OS_MACOSX) | 330 #if defined(OS_MACOSX) |
331 const char kLibraryName[] = "clearkeycdmadapter.plugin"; | 331 const char kLibraryName[] = "clearkeycdmadapter.plugin"; |
332 #elif defined(OS_POSIX) | 332 #elif defined(OS_POSIX) |
333 const char kLibraryName[] = "libclearkeycdmadapter.so"; | 333 const char kLibraryName[] = "libclearkeycdmadapter.so"; |
334 #endif // defined(OS_MACOSX) | 334 #endif // defined(OS_MACOSX) |
335 #endif // defined(OS_WIN) | 335 #endif // defined(OS_WIN) |
336 | 336 |
337 // Append the switch to register the External Clear Key CDM. | 337 // Append the switch to register the External Clear Key CDM. |
338 base::FilePath::StringType pepper_plugins = BuildPepperPluginRegistration( | 338 base::FilePath::StringType pepper_plugins = BuildPepperPluginRegistration( |
339 kLibraryName, "Clear Key CDM", kExternalClearKeyMimeType); | 339 "", kLibraryName, "Clear Key CDM", kExternalClearKeyMimeType); |
340 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) | 340 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) |
341 // The CDM must be registered when it is a component. | 341 // The CDM must be registered when it is a component. |
342 pepper_plugins.append(FILE_PATH_LITERAL(",")); | 342 pepper_plugins.append(FILE_PATH_LITERAL(",")); |
343 pepper_plugins.append( | 343 pepper_plugins.append(BuildPepperPluginRegistration( |
344 BuildPepperPluginRegistration(kWidevineCdmAdapterFileName, | 344 kWidevineCdmBaseDirectory, kWidevineCdmAdapterFileName, |
345 kWidevineCdmDisplayName, | 345 kWidevineCdmDisplayName, kWidevineCdmPluginMimeType)); |
346 kWidevineCdmPluginMimeType)); | |
347 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) | 346 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) |
348 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, | 347 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, |
349 pepper_plugins); | 348 pepper_plugins); |
350 #endif // defined(ENABLE_PEPPER_CDMS) | 349 #endif // defined(ENABLE_PEPPER_CDMS) |
351 | 350 |
352 #if !defined(DISABLE_NACL) | 351 #if !defined(DISABLE_NACL) |
353 // Ensure NaCl can run. | 352 // Ensure NaCl can run. |
354 command_line->AppendSwitch(switches::kEnableNaCl); | 353 command_line->AppendSwitch(switches::kEnableNaCl); |
355 #endif | 354 #endif |
356 } | 355 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 EXPECT_EQ(expect_is_javascript_content_blocked, | 427 EXPECT_EQ(expect_is_javascript_content_blocked, |
429 tab_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_JAVASCRIPT)); | 428 tab_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_JAVASCRIPT)); |
430 EXPECT_FALSE(tab_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS)); | 429 EXPECT_FALSE(tab_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_PLUGINS)); |
431 } | 430 } |
432 | 431 |
433 private: | 432 private: |
434 // Builds the string to pass to kRegisterPepperPlugins for a single | 433 // Builds the string to pass to kRegisterPepperPlugins for a single |
435 // plugin using the provided parameters and a dummy version. | 434 // plugin using the provided parameters and a dummy version. |
436 // Multiple results may be passed to kRegisterPepperPlugins, separated by ",". | 435 // Multiple results may be passed to kRegisterPepperPlugins, separated by ",". |
437 base::FilePath::StringType BuildPepperPluginRegistration( | 436 base::FilePath::StringType BuildPepperPluginRegistration( |
| 437 const char* library_path, |
438 const char* library_name, | 438 const char* library_name, |
439 const char* display_name, | 439 const char* display_name, |
440 const char* mime_type) { | 440 const char* mime_type) { |
441 base::FilePath plugin_dir; | 441 base::FilePath plugin_dir; |
442 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir)); | 442 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir)); |
| 443 plugin_dir = plugin_dir.AppendASCII(library_path); |
443 | 444 |
444 base::FilePath plugin_lib = plugin_dir.AppendASCII(library_name); | 445 base::FilePath plugin_lib = plugin_dir.AppendASCII(library_name); |
445 EXPECT_TRUE(base::PathExists(plugin_lib)); | 446 EXPECT_TRUE(base::PathExists(plugin_lib)); |
446 | 447 |
447 base::FilePath::StringType pepper_plugin = plugin_lib.value(); | 448 base::FilePath::StringType pepper_plugin = plugin_lib.value(); |
448 std::string string_to_append = "#"; | 449 std::string string_to_append = "#"; |
449 string_to_append.append(display_name); | 450 string_to_append.append(display_name); |
450 string_to_append.append("#A CDM#0.1.0.0;"); | 451 string_to_append.append("#A CDM#0.1.0.0;"); |
451 string_to_append.append(mime_type); | 452 string_to_append.append(mime_type); |
452 | 453 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 // Disable this test in Metro+Ash for now (http://crbug.com/262796). | 588 // Disable this test in Metro+Ash for now (http://crbug.com/262796). |
588 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 589 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
589 switches::kAshBrowserTests)) | 590 switches::kAshBrowserTests)) |
590 return; | 591 return; |
591 #endif | 592 #endif |
592 RunJavaScriptBlockedTest("load_nacl_no_js.html", true); | 593 RunJavaScriptBlockedTest("load_nacl_no_js.html", true); |
593 } | 594 } |
594 #endif // !defined(DISABLE_NACL) | 595 #endif // !defined(DISABLE_NACL) |
595 | 596 |
596 #endif // defined(ENABLE_PLUGINS) | 597 #endif // defined(ENABLE_PLUGINS) |
OLD | NEW |