| OLD | NEW |
| 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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 | 650 |
| 651 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, ExpandingSmallPlugin) { | 651 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, ExpandingSmallPlugin) { |
| 652 LoadPeripheralPlugin(); | 652 LoadPeripheralPlugin(); |
| 653 VerifyPluginIsThrottled(GetActiveWebContents(), "plugin"); | 653 VerifyPluginIsThrottled(GetActiveWebContents(), "plugin"); |
| 654 | 654 |
| 655 std::string script = "window.document.getElementById('plugin').height = 400;"; | 655 std::string script = "window.document.getElementById('plugin').height = 400;"; |
| 656 ASSERT_TRUE(content::ExecuteScript(GetActiveWebContents(), script)); | 656 ASSERT_TRUE(content::ExecuteScript(GetActiveWebContents(), script)); |
| 657 VerifyPluginMarkedEssential(GetActiveWebContents(), "plugin"); | 657 VerifyPluginMarkedEssential(GetActiveWebContents(), "plugin"); |
| 658 } | 658 } |
| 659 | 659 |
| 660 // Flaky on all bots. crbug.com/665706 | 660 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, BackgroundTabPlugins) { |
| 661 IN_PROC_BROWSER_TEST_F(PluginPowerSaverBrowserTest, | |
| 662 DISABLED_BackgroundTabPlugins) { | |
| 663 content::WebContents* background_contents = LoadHTMLInBackgroundTab( | 661 content::WebContents* background_contents = LoadHTMLInBackgroundTab( |
| 664 "<object id='same_origin' data='fake.swf' " | 662 "<object id='same_origin' data='fake.swf' " |
| 665 " type='application/x-shockwave-flash'></object>" | 663 " type='application/x-shockwave-flash'></object>" |
| 666 "<object id='small_cross_origin' data='http://otherorigin.com/fake1.swf' " | 664 "<object id='small_cross_origin' data='http://otherorigin.com/fake1.swf' " |
| 667 " type='application/x-shockwave-flash' width='400' height='80'>" | 665 " type='application/x-shockwave-flash' width='400' height='80'>" |
| 668 "</object>"); | 666 "</object>"); |
| 669 | 667 |
| 670 EXPECT_FALSE(PluginLoaded(background_contents, "same_origin")); | 668 EXPECT_FALSE(PluginLoaded(background_contents, "same_origin")); |
| 671 EXPECT_FALSE(PluginLoaded(background_contents, "small_cross_origin")); | 669 EXPECT_FALSE(PluginLoaded(background_contents, "small_cross_origin")); |
| 672 | 670 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 IN_PROC_BROWSER_TEST_F(PluginPowerSaverPreferHtmlBrowserTest, | 781 IN_PROC_BROWSER_TEST_F(PluginPowerSaverPreferHtmlBrowserTest, |
| 784 ThrottlePluginsOnAllowContentSetting) { | 782 ThrottlePluginsOnAllowContentSetting) { |
| 785 HostContentSettingsMap* content_settings_map = | 783 HostContentSettingsMap* content_settings_map = |
| 786 HostContentSettingsMapFactory::GetForProfile(browser()->profile()); | 784 HostContentSettingsMapFactory::GetForProfile(browser()->profile()); |
| 787 | 785 |
| 788 content_settings_map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, | 786 content_settings_map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, |
| 789 CONTENT_SETTING_ALLOW); | 787 CONTENT_SETTING_ALLOW); |
| 790 LoadPeripheralPlugin(); | 788 LoadPeripheralPlugin(); |
| 791 VerifyPluginIsThrottled(GetActiveWebContents(), "plugin"); | 789 VerifyPluginIsThrottled(GetActiveWebContents(), "plugin"); |
| 792 } | 790 } |
| OLD | NEW |