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

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

Issue 1421693002: Plugin Power Saver: Do not always throttle plugins with posters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0025-pps-poster-pixel-tests
Patch Set: Created 5 years, 2 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 | components/plugins/renderer/loadable_plugin_placeholder.h » ('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 333720d38cf3728abeb7a5bffab2b9efd6ca013e..3272b553d060dee7f295262c7b264d1a28e6d653 100644
--- a/chrome/browser/plugins/plugin_power_saver_browsertest.cc
+++ b/chrome/browser/plugins/plugin_power_saver_browsertest.cc
@@ -225,6 +225,29 @@ IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest,
EXPECT_FALSE(PluginLoaded(GetActiveWebContents(), "plugin_embed_srcset"));
}
+IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, LargePostersNotThrottled) {
+ // This test verifies that small posters are throttled, large posters are not,
+ // and that large posters can whitelist origins for other plugins.
+ LoadHTML(
+ "<object id='poster_small' data='http://a.com/fake.swf' "
+ " type='application/x-ppapi-tests' width='50' height='50' "
+ " poster='click_me.png'></object>"
+ "<object id='poster_whitelisted_origin' data='http://b.com/fake.swf' "
+ " type='application/x-ppapi-tests' width='50' height='50' "
+ " poster='click_me.png'></object>"
+ "<object id='plugin_whitelisted_origin' data='http://b.com/fake.swf' "
+ " type='application/x-ppapi-tests' width='50' height='50'></object>"
+ "<br>"
+ "<object id='poster_large' data='http://b.com/fake.swf' "
+ " type='application/x-ppapi-tests' width='400' height='300' "
+ " poster='click_me.png'></object>");
+
+ EXPECT_FALSE(PluginLoaded(GetActiveWebContents(), "poster_small"));
+ VerifyPluginMarkedEssential(GetActiveWebContents(),
+ "plugin_whitelisted_origin");
+ VerifyPluginMarkedEssential(GetActiveWebContents(), "poster_large");
+}
+
IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest,
PluginMarkedEssentialAfterPosterClicked) {
LoadHTML(
@@ -237,13 +260,17 @@ IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest,
IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, OriginWhitelisting) {
LoadHTML(
- "<object id='plugin1' data='http://otherorigin.com/fake1.swf' "
- " type='application/x-ppapi-tests' width='400' height='100'></object>"
- "<object id='plugin2' data='http://otherorigin.com/fake2.swf' "
+ "<object id='plugin_small' data='http://a.com/fake1.swf' "
+ " type='application/x-ppapi-tests' width='100' height='100'></object>"
+ "<object id='plugin_small_poster' data='http://a.com/fake1.swf' "
+ " type='application/x-ppapi-tests' width='100' height='100' "
+ " poster='click_me.png'></object>"
+ "<object id='plugin_large' data='http://a.com/fake2.swf' "
" type='application/x-ppapi-tests' width='400' height='500'>"
"</object>");
- VerifyPluginMarkedEssential(GetActiveWebContents(), "plugin1");
- VerifyPluginMarkedEssential(GetActiveWebContents(), "plugin2");
+ VerifyPluginMarkedEssential(GetActiveWebContents(), "plugin_small");
+ VerifyPluginMarkedEssential(GetActiveWebContents(), "plugin_small_poster");
+ VerifyPluginMarkedEssential(GetActiveWebContents(), "plugin_large");
}
IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, LargeCrossOriginObscured) {
« no previous file with comments | « no previous file | components/plugins/renderer/loadable_plugin_placeholder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698