| Index: content/public/test/ppapi_test_utils.cc
|
| diff --git a/content/public/test/ppapi_test_utils.cc b/content/public/test/ppapi_test_utils.cc
|
| index 0c9e5455c26ebe65a8d84fe06b01dc17634e51c4..6078594d8bd637d26f5f7532b32a201bdf2ca54e 100644
|
| --- a/content/public/test/ppapi_test_utils.cc
|
| +++ b/content/public/test/ppapi_test_utils.cc
|
| @@ -18,7 +18,8 @@ namespace {
|
| bool RegisterPlugin(
|
| base::CommandLine* command_line,
|
| const base::FilePath::StringType& library_name,
|
| - const base::FilePath::StringType& extra_registration_parameters) {
|
| + const base::FilePath::StringType& extra_registration_parameters,
|
| + const base::FilePath::StringType& mime_type) {
|
| base::FilePath plugin_dir;
|
| if (!PathService::Get(base::DIR_MODULE, &plugin_dir))
|
| return false;
|
| @@ -30,12 +31,22 @@ bool RegisterPlugin(
|
| return false;
|
| base::FilePath::StringType pepper_plugin = plugin_path.value();
|
| pepper_plugin.append(extra_registration_parameters);
|
| - pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests"));
|
| + pepper_plugin.append(FILE_PATH_LITERAL(";"));
|
| + pepper_plugin.append(mime_type);
|
| command_line->AppendSwitchNative(switches::kRegisterPepperPlugins,
|
| pepper_plugin);
|
| return true;
|
| }
|
|
|
| +bool RegisterPluginWithDefaultMimeType(
|
| + base::CommandLine* command_line,
|
| + const base::FilePath::StringType& library_name,
|
| + const base::FilePath::StringType& extra_registration_parameters) {
|
| + return RegisterPlugin(command_line, library_name,
|
| + extra_registration_parameters,
|
| + FILE_PATH_LITERAL("application/x-ppapi-tests"));
|
| +}
|
| +
|
| } // namespace
|
|
|
| bool RegisterTestPlugin(base::CommandLine* command_line) {
|
| @@ -53,14 +64,32 @@ bool RegisterTestPluginWithExtraParameters(
|
| #elif defined(OS_POSIX)
|
| base::FilePath::StringType plugin_library = "libppapi_tests.so";
|
| #endif
|
| - return RegisterPlugin(command_line, plugin_library,
|
| - extra_registration_parameters);
|
| + return RegisterPluginWithDefaultMimeType(command_line, plugin_library,
|
| + extra_registration_parameters);
|
| }
|
|
|
| bool RegisterPowerSaverTestPlugin(base::CommandLine* command_line) {
|
| base::FilePath::StringType library_name =
|
| base::FilePath::FromUTF8Unsafe(ppapi::kPowerSaverTestPluginName).value();
|
| - return RegisterPlugin(command_line, library_name, FILE_PATH_LITERAL(""));
|
| + return RegisterPluginWithDefaultMimeType(command_line, library_name,
|
| + FILE_PATH_LITERAL(""));
|
| }
|
|
|
| +bool RegisterBlinkTestPlugin(base::CommandLine* command_line) {
|
| +#if defined(OS_WIN)
|
| + static const base::FilePath::CharType kPluginLibrary[] =
|
| + L"blink_test_plugin.dll";
|
| +#elif defined(OS_MACOSX)
|
| + static const base::FilePath::CharType kPluginLibrary[] =
|
| + "blink_test_plugin.plugin";
|
| +#elif defined(OS_POSIX)
|
| + static const base::FilePath::CharType kPluginLibrary[] =
|
| + "libblink_test_plugin.so";
|
| +#endif
|
| + // #name#description#version
|
| + static const base::FilePath::CharType kExtraParameters[] =
|
| + FILE_PATH_LITERAL("#Blink Test Plugin#Interesting description.#0.8");
|
| + return RegisterPlugin(command_line, kPluginLibrary, kExtraParameters,
|
| + FILE_PATH_LITERAL("application/x-blink-test-plugin"));
|
| +}
|
| } // namespace ppapi
|
|
|