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

Unified Diff: chrome/browser/plugins/plugin_power_saver_browsertest.cc

Issue 2627493002: [PPS] Exclude same-origin tiny plugins. (Closed)
Patch Set: fix test Created 3 years, 11 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
« no previous file with comments | « no previous file | chrome/renderer/plugins/power_saver_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugins/plugin_power_saver_browsertest.cc
diff --git a/chrome/browser/plugins/plugin_power_saver_browsertest.cc b/chrome/browser/plugins/plugin_power_saver_browsertest.cc
index 183b003666aaad4cf8ec46d8e14d97070866bacd..4727c2da17f48cccbff76983b5a3a9c73bfe6e4f 100644
--- a/chrome/browser/plugins/plugin_power_saver_browsertest.cc
+++ b/chrome/browser/plugins/plugin_power_saver_browsertest.cc
@@ -28,6 +28,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
+#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/ppapi_test_utils.h"
@@ -599,6 +600,32 @@ IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, ExpandingTinyPlugins) {
VerifyPluginMarkedEssential(GetActiveWebContents(), "expand_to_essential");
}
+// Separate test case with FilterSameOriginTinyPlugins feature flag on.
+class PluginPowerSaverFilterSameOriginTinyPluginsBrowserTest
+ : public PluginPowerSaverBrowserTest {
+ public:
+ void SetUpInProcessBrowserTestFixture() override {
jochen (gone - plz use gerrit) 2017/01/11 09:48:06 nit. please add a virtual dtor
tommycli 2017/01/11 18:34:40 Hey. The base class doesn't have an explicitly dec
+ // Although this is redundant with the Field Trial testing configuration,
+ // the official builders don't read that.
+ feature_list.InitWithFeatures({features::kFilterSameOriginTinyPlugin},
+ {features::kPreferHtmlOverPlugins});
+ }
+
+ private:
+ base::test::ScopedFeatureList feature_list;
+};
+
+IN_PROC_BROWSER_TEST_F(PluginPowerSaverFilterSameOriginTinyPluginsBrowserTest,
+ BlockSameOriginTinyPlugin) {
+ LoadHTML("/same_origin_tiny_plugin.html");
+
+ VerifyPluginIsPlaceholderOnly("tiny_same_origin");
+
+ TabSpecificContentSettings* tab_specific_content_settings =
+ TabSpecificContentSettings::FromWebContents(GetActiveWebContents());
+ EXPECT_FALSE(tab_specific_content_settings->blocked_plugin_names().empty());
+}
+
// Separate test case with HTML By Default feature flag on.
class PluginPowerSaverPreferHtmlBrowserTest
: public PluginPowerSaverBrowserTest {
« no previous file with comments | « no previous file | chrome/renderer/plugins/power_saver_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698