Chromium Code Reviews| 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 { |