| 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 // Although this is redundant with the Field Trial testing configuration, | 610 // Although this is redundant with the Field Trial testing configuration, |
| 611 // the official builders don't read that. | 611 // the official builders don't read that. |
| 612 feature_list.InitWithFeatures({features::kFilterSameOriginTinyPlugin}, | 612 feature_list.InitWithFeatures({features::kFilterSameOriginTinyPlugin}, |
| 613 {features::kPreferHtmlOverPlugins}); | 613 {features::kPreferHtmlOverPlugins}); |
| 614 } | 614 } |
| 615 | 615 |
| 616 private: | 616 private: |
| 617 base::test::ScopedFeatureList feature_list; | 617 base::test::ScopedFeatureList feature_list; |
| 618 }; | 618 }; |
| 619 | 619 |
| 620 // Flaky on Mac. crbug.com/680544 | 620 // Flaky on every platform. crbug.com/680544, crbug.com/682039 |
| 621 // Flaky on Win7. crbug.com/682039 | |
| 622 #if defined(OS_MACOSX) || defined(OS_WIN) | |
| 623 #define MAYBE_BlockSameOriginTinyPlugin DISABLED_BlockSameOriginTinyPlugin | |
| 624 #else | |
| 625 #define MAYBE_BlockSameOriginTinyPlugin BlockSameOriginTinyPlugin | |
| 626 #endif | |
| 627 IN_PROC_BROWSER_TEST_F(PluginPowerSaverFilterSameOriginTinyPluginsBrowserTest, | 621 IN_PROC_BROWSER_TEST_F(PluginPowerSaverFilterSameOriginTinyPluginsBrowserTest, |
| 628 MAYBE_BlockSameOriginTinyPlugin) { | 622 DISABLED_BlockSameOriginTinyPlugin) { |
| 629 LoadHTML("/same_origin_tiny_plugin.html"); | 623 LoadHTML("/same_origin_tiny_plugin.html"); |
| 630 | 624 |
| 631 VerifyPluginIsPlaceholderOnly("tiny_same_origin"); | 625 VerifyPluginIsPlaceholderOnly("tiny_same_origin"); |
| 632 | 626 |
| 633 TabSpecificContentSettings* tab_specific_content_settings = | 627 TabSpecificContentSettings* tab_specific_content_settings = |
| 634 TabSpecificContentSettings::FromWebContents(GetActiveWebContents()); | 628 TabSpecificContentSettings::FromWebContents(GetActiveWebContents()); |
| 635 EXPECT_FALSE(tab_specific_content_settings->blocked_plugin_names().empty()); | 629 EXPECT_FALSE(tab_specific_content_settings->blocked_plugin_names().empty()); |
| 636 } | 630 } |
| 637 | 631 |
| 638 // Separate test case with HTML By Default feature flag on. | 632 // Separate test case with HTML By Default feature flag on. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 652 IN_PROC_BROWSER_TEST_F(PluginPowerSaverPreferHtmlBrowserTest, | 646 IN_PROC_BROWSER_TEST_F(PluginPowerSaverPreferHtmlBrowserTest, |
| 653 ThrottlePluginsOnAllowContentSetting) { | 647 ThrottlePluginsOnAllowContentSetting) { |
| 654 HostContentSettingsMap* content_settings_map = | 648 HostContentSettingsMap* content_settings_map = |
| 655 HostContentSettingsMapFactory::GetForProfile(browser()->profile()); | 649 HostContentSettingsMapFactory::GetForProfile(browser()->profile()); |
| 656 | 650 |
| 657 content_settings_map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, | 651 content_settings_map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, |
| 658 CONTENT_SETTING_ALLOW); | 652 CONTENT_SETTING_ALLOW); |
| 659 LoadPeripheralPlugin(); | 653 LoadPeripheralPlugin(); |
| 660 VerifyPluginIsThrottled(GetActiveWebContents(), "plugin"); | 654 VerifyPluginIsThrottled(GetActiveWebContents(), "plugin"); |
| 661 } | 655 } |
| OLD | NEW |