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

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 829113004: Plugin Power Saver: Add back 'Click to play' option as 4th for plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <deque> 5 #include <deque>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 2061 matching lines...) Expand 10 before | Expand all | Expand 10 after
2072 HostContentSettingsMap* content_settings_map = 2072 HostContentSettingsMap* content_settings_map =
2073 current_browser()->profile()->GetHostContentSettingsMap(); 2073 current_browser()->profile()->GetHostContentSettingsMap();
2074 content_settings_map->SetDefaultContentSetting( 2074 content_settings_map->SetDefaultContentSetting(
2075 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_DETECT_IMPORTANT_CONTENT); 2075 CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_DETECT_IMPORTANT_CONTENT);
2076 2076
2077 PrerenderTestURL("files/prerender/prerender_plugin_power_saver.html", 2077 PrerenderTestURL("files/prerender/prerender_plugin_power_saver.html",
2078 FINAL_STATUS_USED, 1); 2078 FINAL_STATUS_USED, 1);
2079 NavigateToDestURL(); 2079 NavigateToDestURL();
2080 } 2080 }
2081 2081
2082 // Checks that plugins are not loaded on prerendering pages when click-to-play
2083 // is enabled.
2084 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderClickToPlay) {
2085 // Enable click-to-play.
2086 HostContentSettingsMap* content_settings_map =
2087 current_browser()->profile()->GetHostContentSettingsMap();
2088 content_settings_map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS,
2089 CONTENT_SETTING_ASK);
2090
2091 PrerenderTestURL("files/prerender/prerender_plugin_click_to_play.html",
2092 FINAL_STATUS_USED, 1);
2093 NavigateToDestURL();
2094 }
2095
2082 // Checks that we don't load a NaCl plugin when NaCl is disabled. 2096 // Checks that we don't load a NaCl plugin when NaCl is disabled.
2083 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderNaClPluginDisabled) { 2097 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderNaClPluginDisabled) {
2084 PrerenderTestURL("files/prerender/prerender_plugin_nacl_disabled.html", 2098 PrerenderTestURL("files/prerender/prerender_plugin_nacl_disabled.html",
2085 FINAL_STATUS_USED, 2099 FINAL_STATUS_USED,
2086 1); 2100 1);
2087 NavigateToDestURL(); 2101 NavigateToDestURL();
2088 2102
2089 2103
2090 // Run this check again. When we try to load aa ppapi plugin, the 2104 // Run this check again. When we try to load aa ppapi plugin, the
2091 // "loadstart" event is asynchronously posted to a message loop. 2105 // "loadstart" event is asynchronously posted to a message loop.
(...skipping 2489 matching lines...) Expand 10 before | Expand all | Expand 10 after
4581 TestShouldDisableLocalPredictorPreferenceNetworkMatrix( 4595 TestShouldDisableLocalPredictorPreferenceNetworkMatrix(
4582 true /*preference_wifi_network_wifi*/, 4596 true /*preference_wifi_network_wifi*/,
4583 true /*preference_wifi_network_4g*/, 4597 true /*preference_wifi_network_4g*/,
4584 true /*preference_always_network_wifi*/, 4598 true /*preference_always_network_wifi*/,
4585 false /*preference_always_network_4g*/, 4599 false /*preference_always_network_4g*/,
4586 true /*preference_never_network_wifi*/, 4600 true /*preference_never_network_wifi*/,
4587 true /*preference_never_network_4g*/); 4601 true /*preference_never_network_4g*/);
4588 } 4602 }
4589 4603
4590 } // namespace prerender 4604 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/plugins/plugin_info_message_filter.cc ('k') | chrome/browser/resources/options/content_settings.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698