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

Side by Side Diff: chrome/browser/plugins/plugin_power_saver_browsertest.cc

Issue 2765633002: Plugin Power Saver Tiny: Treat completely obscured plugins as Tiny. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/data/plugin_power_saver/block_tiny_plugins.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h> 5 #include <stdint.h>
6 #include <string> 6 #include <string>
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 LoadHTML("/zoom_independent.html"); 562 LoadHTML("/zoom_independent.html");
563 VerifyPluginIsThrottled(GetActiveWebContents(), "plugin"); 563 VerifyPluginIsThrottled(GetActiveWebContents(), "plugin");
564 } 564 }
565 565
566 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, BlockTinyPlugins) { 566 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, BlockTinyPlugins) {
567 LoadHTML("/block_tiny_plugins.html"); 567 LoadHTML("/block_tiny_plugins.html");
568 568
569 VerifyPluginMarkedEssential(GetActiveWebContents(), "tiny_same_origin"); 569 VerifyPluginMarkedEssential(GetActiveWebContents(), "tiny_same_origin");
570 VerifyPluginIsPlaceholderOnly("tiny_cross_origin_1"); 570 VerifyPluginIsPlaceholderOnly("tiny_cross_origin_1");
571 VerifyPluginIsPlaceholderOnly("tiny_cross_origin_2"); 571 VerifyPluginIsPlaceholderOnly("tiny_cross_origin_2");
572 VerifyPluginIsPlaceholderOnly("completely_obscured");
572 573
573 TabSpecificContentSettings* tab_specific_content_settings = 574 TabSpecificContentSettings* tab_specific_content_settings =
574 TabSpecificContentSettings::FromWebContents(GetActiveWebContents()); 575 TabSpecificContentSettings::FromWebContents(GetActiveWebContents());
575 EXPECT_FALSE(tab_specific_content_settings->blocked_plugin_names().empty()); 576 EXPECT_FALSE(tab_specific_content_settings->blocked_plugin_names().empty());
576 } 577 }
577 578
578 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, BackgroundTabTinyPlugins) { 579 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, BackgroundTabTinyPlugins) {
579 content::WebContents* background_contents = 580 content::WebContents* background_contents =
580 LoadHTMLInBackgroundTab("/background_tab_tiny_plugins.html"); 581 LoadHTMLInBackgroundTab("/background_tab_tiny_plugins.html");
581 EXPECT_FALSE(PluginLoaded(background_contents, "tiny")); 582 EXPECT_FALSE(PluginLoaded(background_contents, "tiny"));
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 IN_PROC_BROWSER_TEST_F(PluginPowerSaverPreferHtmlBrowserTest, 652 IN_PROC_BROWSER_TEST_F(PluginPowerSaverPreferHtmlBrowserTest,
652 ThrottlePluginsOnAllowContentSetting) { 653 ThrottlePluginsOnAllowContentSetting) {
653 HostContentSettingsMap* content_settings_map = 654 HostContentSettingsMap* content_settings_map =
654 HostContentSettingsMapFactory::GetForProfile(browser()->profile()); 655 HostContentSettingsMapFactory::GetForProfile(browser()->profile());
655 656
656 content_settings_map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, 657 content_settings_map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS,
657 CONTENT_SETTING_ALLOW); 658 CONTENT_SETTING_ALLOW);
658 LoadPeripheralPlugin(); 659 LoadPeripheralPlugin();
659 VerifyPluginIsThrottled(GetActiveWebContents(), "plugin"); 660 VerifyPluginIsThrottled(GetActiveWebContents(), "plugin");
660 } 661 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/plugin_power_saver/block_tiny_plugins.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698