Commit 450f7edc authored by Robert Ogden's avatar Robert Ogden Committed by Commit Bot

Remove defunct prerender browsertests

No longer needed with No State Prefetch.

Bug: 1039414
Change-Id: If6308fb00658bf239fbd90aa8bb8d7c29d3ef759
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2157873
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Commit-Queue: Ryan Sturm <ryansturm@chromium.org>
Auto-Submit: Robert Ogden <robertogden@chromium.org>
Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760742}
parent 73ae5ef1
......@@ -1064,87 +1064,6 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
EXPECT_TRUE(IsEmptyPrerenderLinkManager());
}
// 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, PrerenderDelayLoadPlugin) {
HostContentSettingsMap* content_settings_map =
HostContentSettingsMapFactory::GetForProfile(
current_browser()->profile());
GURL server_root = embedded_test_server()->GetURL("/");
content_settings_map->SetContentSettingDefaultScope(
server_root, server_root, ContentSettingsType::PLUGINS, std::string(),
CONTENT_SETTING_ALLOW);
PrerenderTestURL("/prerender/prerender_plugin_delay_load.html",
FINAL_STATUS_USED, 1);
NavigateToDestURL();
// Because NavigateToDestURL relies on a synchronous check, and the plugin
// loads asynchronously, we use a separate DidPluginLoad() test. Failure
// is indicated by timeout, as plugins may take arbitrarily long to load.
bool plugin_loaded = false;
ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
GetActiveWebContents(), "DidPluginLoad()", &plugin_loaded));
EXPECT_TRUE(plugin_loaded);
}
// 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, PrerenderPluginPowerSaver) {
HostContentSettingsMap* content_settings_map =
HostContentSettingsMapFactory::GetForProfile(
current_browser()->profile());
GURL server_root = embedded_test_server()->GetURL("/");
content_settings_map->SetContentSettingDefaultScope(
server_root, server_root, ContentSettingsType::PLUGINS, std::string(),
CONTENT_SETTING_ALLOW);
PrerenderTestURL("/prerender/prerender_plugin_power_saver.html",
FINAL_STATUS_USED, 1);
DisableJavascriptCalls();
NavigateToDestURL();
bool second_placeholder_present = false;
ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
GetActiveWebContents(), "AwaitPluginPrerollAndPlaceholder();",
&second_placeholder_present));
EXPECT_TRUE(second_placeholder_present);
}
// Checks that plugins in an iframe are not loaded while a page is
// being preloaded, but are loaded when the page is displayed.
#if defined(USE_AURA) && !defined(OS_WIN)
// http://crbug.com/103496
#define MAYBE_PrerenderIframeDelayLoadPlugin \
DISABLED_PrerenderIframeDelayLoadPlugin
#elif defined(OS_MACOSX)
// http://crbug.com/100514
#define MAYBE_PrerenderIframeDelayLoadPlugin \
DISABLED_PrerenderIframeDelayLoadPlugin
#elif defined(OS_WIN)
// TODO(jschuh): Failing plugin tests. https://crbug.com/244653,
// https://crbug.com/876872
#define MAYBE_PrerenderIframeDelayLoadPlugin \
DISABLED_PrerenderIframeDelayLoadPlugin
#else
#define MAYBE_PrerenderIframeDelayLoadPlugin PrerenderIframeDelayLoadPlugin
#endif
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
MAYBE_PrerenderIframeDelayLoadPlugin) {
HostContentSettingsMap* content_settings_map =
HostContentSettingsMapFactory::GetForProfile(
current_browser()->profile());
GURL server_root = embedded_test_server()->GetURL("/");
content_settings_map->SetContentSettingDefaultScope(
server_root, server_root, ContentSettingsType::PLUGINS, std::string(),
CONTENT_SETTING_ALLOW);
PrerenderTestURL("/prerender/prerender_iframe_plugin_delay_load.html",
FINAL_STATUS_USED, 1);
NavigateToDestURL();
}
// Renders a page that contains a prerender link to a page that contains an
// iframe with a source that requires http authentication. This should not
// prerender successfully.
......@@ -1382,7 +1301,6 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
WindowOpenDisposition::CURRENT_TAB, false);
}
// Sets up HTTPS server for prerendered page, and checks that an SSL error will
// cancel the prerender. The prerenderer loader will be served through HTTP.
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderSSLErrorTopLevel) {
......
<html>
<!--
This test checks to make sure that plugins in an iframe are only
loaded once a page is displayed.
-->
<head>
<title>Prerender Iframe Plugins</title>
</head>
<script>
// Make sure plugin was not loaded while prerendering.
function DidPrerenderPass() {
var plugin_iframe = document.getElementById('plugin_iframe');
return plugin_iframe.contentWindow.DidPrerenderPass();
}
// Make sure plugin loads once the page is displayed.
function DidDisplayPass() {
var plugin_iframe = document.getElementById('plugin_iframe');
return plugin_iframe.contentWindow.DidDisplayPass();
}
</script>
<body>
<iframe src="prerender_plugin_delay_load.html" id="plugin_iframe"></iframe>
</body>
</html>
<html>
<!--
This test checks to make sure plugins aren't loaded when a page is prerendered,
but are loaded once the page is displayed.
This test relies on the Pepper plugin (but not the placeholder) implementing
the postMessage() function on the plugin object.
-->
<head>
<title>Prerender Plugin Delay Loading</title>
<script>
// Make sure plugin was not loaded while prerendering.
function DidPrerenderPass() {
// |plugin| should be the blocked plugin placeholder, rather than the
// test plugin.
var plugin = window.document['plugin'];
return plugin.postMessage == undefined;
}
// DidDisplayPass requires a synchronously returned result, but we can't
// determine if the delayed plugin loaded correctly synchronously.
function DidDisplayPass() {
return true;
}
// Make sure plugin loads once the page is displayed.
function DidPluginLoad() {
var plugin = window.document['plugin'];
// Listen for either the initial status ping, or the requested status ping.
plugin.addEventListener('message', function handleEvent(event) {
if (event.data.source === 'getPowerSaverStatusResponse' ||
event.data.source === 'initial') {
plugin.removeEventListener('message', handleEvent);
window.domAutomationController.send(true);
}
});
// If the plugin has already loaded, we have missed the initial status ping,
// so we specifically request one.
if (plugin.postMessage)
plugin.postMessage('getPowerSaverStatus');
// Plugins don't have a time limit for loading, so failure is via timeout.
}
</script>
</head>
<body>
<!-- Specifically define the data attribute to be same-origin. Otherwise,
Plugin Power Saver will further defer the loading of the plugin. -->
<object name='plugin' data='fake.swf' type='application/x-shockwave-flash'>
</object>
</body>
</html>
<html>
<!--
This test checks the interaction between prerendering and the Plugin Power Saver
feature. It expects:
- The plugin is not loaded during prerender.
- It is loaded (briefly) during the preroll of the plugin.
- It is replaced by the power saver placeholder after the preroll is over.
This test relies on the Pepper plugin (but not the placeholder) implementing
the postMessage() function on the plugin object.
-->
<head>
<title>Prerender Plugin Delay Loading</title>
<script>
// Make sure plugin was not loaded while prerendering.
function DidPrerenderPass() {
// |plugin| should be the blocked plugin placeholder, rather than the
// test plugin.
var plugin = window.document.getElementById('plugin');
return plugin.postMessage === undefined;
}
// Make sure the plugin briefly exists, then is replaced with a placeholder.
function AwaitPluginPrerollAndPlaceholder() {
var plugin = window.document.getElementById('plugin');
function handleEvent(event) {
// We should eventually get a message indicating that the plugin has been
// throttled and replaced with a static placeholder.
if (event.data.isThrottled && event.data.isHiddenForPlaceholder) {
plugin.removeEventListener('message', handleEvent);
window.domAutomationController.send(true);
}
}
plugin.addEventListener('message', handleEvent);
// If postMessage is not defined, the plugin is still the initial placeholder.
// When the real plugin loads, we will still get the initial power saver
// status notifications.
if (plugin.postMessage !== undefined) {
plugin.postMessage('getPowerSaverStatus');
}
}
</script>
</head>
<body>
<object id="plugin" type="application/x-shockwave-flash"
height='100' width='100'>
</object>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment