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