Chromium Code Reviews| 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 879dad657628d750215652d2d00819e7c66855e4..9fa9b42e1f98775bf19f33974325630871fa2e87 100644 |
| --- a/content/public/test/ppapi_test_utils.cc |
| +++ b/content/public/test/ppapi_test_utils.cc |
| @@ -11,8 +11,10 @@ |
| #include "base/macros.h" |
| #include "base/path_service.h" |
| #include "build/build_config.h" |
| +#include "content/public/common/content_constants.h" |
| #include "content/public/common/content_switches.h" |
| #include "ppapi/shared_impl/ppapi_constants.h" |
| +#include "ppapi/shared_impl/ppapi_switches.h" |
| using CharType = base::FilePath::CharType; |
| using StringType = base::FilePath::StringType; |
| @@ -88,11 +90,22 @@ bool RegisterTestPluginWithExtraParameters( |
| extra_registration_parameters); |
| } |
| -bool RegisterPowerSaverTestPlugin(base::CommandLine* command_line) { |
| +bool RegisterFlashTestPlugin(base::CommandLine* command_line) { |
|
xhwang
2016/09/27 20:35:26
Please add some more comments. It's very confusing
tommycli
2016/09/27 20:45:38
Done.
|
| + // Power Saver plugin requires Pepper testing API. |
| + command_line->AppendSwitch(switches::kEnablePepperTesting); |
| + |
| base::FilePath::StringType library_name = |
| base::FilePath::FromUTF8Unsafe(ppapi::kPowerSaverTestPluginName).value(); |
| - return RegisterPluginWithDefaultMimeType(command_line, library_name, |
| - FILE_PATH_LITERAL("")); |
| + std::vector<PluginInfo> plugins; |
| + // Register a fake Flash with 100.0 version (to avoid outdated checks). |
| + base::FilePath::StringType fake_flash_parameter = |
| + base::FilePath::FromUTF8Unsafe( |
| + std::string("#") + content::kFlashPluginName + "#Description#100.0") |
| + .value(); |
| + plugins.push_back( |
| + PluginInfo(library_name, fake_flash_parameter, |
| + FILE_PATH_LITERAL("application/x-shockwave-flash"))); |
| + return RegisterPlugins(command_line, plugins); |
| } |
| bool RegisterBlinkTestPlugin(base::CommandLine* command_line) { |