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

Unified Diff: content/renderer/pepper/plugin_power_saver_helper.cc

Issue 1088763002: Plugin Power Saver: Add comprehensive browser tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0260-plugins-overhaul-prerender-tests
Patch Set: Created 5 years, 8 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/renderer/pepper/plugin_power_saver_helper.cc
diff --git a/content/renderer/pepper/plugin_power_saver_helper.cc b/content/renderer/pepper/plugin_power_saver_helper.cc
index 2891980fe7f49c4afeeeaf95401667698a6f4155..be63331681d127f2e57ea68aa853ea5f2a721583 100644
--- a/content/renderer/pepper/plugin_power_saver_helper.cc
+++ b/content/renderer/pepper/plugin_power_saver_helper.cc
@@ -9,6 +9,8 @@
#include "content/common/frame_messages.h"
#include "content/public/common/content_constants.h"
#include "content/public/renderer/render_frame.h"
+#include "content/public/test/ppapi_test_utils.h"
+#include "ppapi/shared_impl/ppapi_constants.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebPluginParams.h"
@@ -121,8 +123,11 @@ bool PluginPowerSaverHelper::ShouldThrottleContent(
*cross_origin_main_content = false;
// This feature has only been tested throughly with Flash thus far.
- if (plugin_module_name != content::kFlashPluginName)
+ // It is also enabled for the PPAPI test library for browser tests.
+ if (plugin_module_name != content::kFlashPluginName &&
+ plugin_module_name != ppapi::kPpapiTestLibraryName) {
return false;
+ }
if (width <= 0 || height <= 0)
return false;

Powered by Google App Engine
This is Rietveld 408576698