Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Unified Diff: content/public/test/ppapi_test_utils.cc

Issue 2356053002: [HBD] Only use Plugin Content Settings for Flash. (Closed)
Patch Set: fix prerender tests Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..4515a06ea443ac519ce14b3f100892350c54b5ff 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;
@@ -62,8 +64,9 @@ bool RegisterPluginWithDefaultMimeType(
const base::FilePath::StringType& library_name,
const base::FilePath::StringType& extra_registration_parameters) {
std::vector<PluginInfo> plugins;
- plugins.push_back(PluginInfo(library_name, extra_registration_parameters,
- FILE_PATH_LITERAL("application/x-ppapi-tests")));
+ plugins.push_back(PluginInfo(
+ library_name, extra_registration_parameters,
+ base::FilePath::FromUTF8Unsafe(content::kTestPluginMimeType).value()));
return RegisterPlugins(command_line, plugins);
}
@@ -89,10 +92,18 @@ bool RegisterTestPluginWithExtraParameters(
}
bool RegisterPowerSaverTestPlugin(base::CommandLine* command_line) {
+ // Power Saver plugin requires Pepper testing API.
+ command_line->AppendSwitch(switches::kEnablePepperTesting);
+
base::FilePath::StringType library_name =
base::FilePath::FromUTF8Unsafe(ppapi::kPowerSaverTestPluginName).value();
+ // 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();
return RegisterPluginWithDefaultMimeType(command_line, library_name,
- FILE_PATH_LITERAL(""));
+ fake_flash_parameter);
}
bool RegisterBlinkTestPlugin(base::CommandLine* command_line) {

Powered by Google App Engine
This is Rietveld 408576698