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

Unified Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 2356053002: [HBD] Only use Plugin Content Settings for Flash. (Closed)
Patch Set: fix prerender tests Created 4 years, 3 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
Index: chrome/browser/prerender/prerender_browsertest.cc
diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc
index 1ca412d4ec5ca41961f22eed0b8c2107fb2d02de..cc7ec0ab4d7100750881ae5dd70a80a7a7d34cfb 100644
--- a/chrome/browser/prerender/prerender_browsertest.cc
+++ b/chrome/browser/prerender/prerender_browsertest.cc
@@ -26,6 +26,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/histogram_tester.h"
+#include "base/test/scoped_feature_list.h"
#include "base/test/test_timeouts.h"
#include "base/values.h"
#include "build/build_config.h"
@@ -62,6 +63,7 @@
#include "chrome/browser/ui/location_bar/location_bar.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
+#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/grit/generated_resources.h"
@@ -91,6 +93,7 @@
#include "content/public/common/resource_request_body.h"
#include "content/public/common/url_constants.h"
#include "content/public/test/browser_test_utils.h"
+#include "content/public/test/ppapi_test_utils.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/public/test/test_utils.h"
#include "extensions/common/constants.h"
@@ -604,6 +607,7 @@ class PrerenderBrowserTest : public test_utils::PrerenderInProcessBrowserTest {
PrerenderInProcessBrowserTest::SetUpCommandLine(command_line);
command_line->AppendSwitchASCII(switches::kPrerenderMode,
switches::kPrerenderModeSwitchValueEnabled);
+ ASSERT_TRUE(ppapi::RegisterPowerSaverTestPlugin(command_line));
}
void NavigateToDestURL() const {
@@ -1350,9 +1354,25 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderDelayLoadPlugin) {
NavigateToDestURL();
}
-// For Content Setting DETECT, checks that plugins are not loaded while
+// TODO(tommycli): Remove once we implement PPS on ALLOW. crbug.com/649814
xhwang 2016/09/26 23:44:51 What is PPS?
tommycli 2016/09/27 18:51:07 Done.
+class PrerenderBrowserTestWithPluginPowerSaver : public PrerenderBrowserTest {
+ public:
+ PrerenderBrowserTestWithPluginPowerSaver() {}
+ ~PrerenderBrowserTestWithPluginPowerSaver() override {}
+
+ void SetUpInProcessBrowserTestFixture() override {
+ PrerenderBrowserTest::SetUpInProcessBrowserTestFixture();
+ feature_list.InitAndDisableFeature(features::kPreferHtmlOverPlugins);
+ }
+
+ private:
+ base::test::ScopedFeatureList feature_list;
+};
+
+// For Plugin Power Saver, checks that plugins are not loaded while
// a page is being preloaded, but are loaded when the page is displayed.
-IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderContentSettingDetect) {
+IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithPluginPowerSaver,
+ PrerenderPluginPowerSaver) {
HostContentSettingsMap* content_settings_map =
HostContentSettingsMapFactory::GetForProfile(
current_browser()->profile());

Powered by Google App Engine
This is Rietveld 408576698