Commit 76ab62b1 authored by gavinp@chromium.org's avatar gavinp@chromium.org

New WebKitBrowserTest for content_shell not providing a prerenderer client.

The content_shell doesn't provide a prerendererclient (and chromium and DumpRenderTree do). This browsertest makes sure that encountering a prerendering element doesn't crash the content_shell.

This patch must land after https://bugs.webkit.org/show_bug.cgi?id=95036 lands and is gardened into Chromium.

R=jam@chromium.org
BUG=144556

Review URL: https://chromiumcodereview.appspot.com/10869068

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153596 0039d316-1c4b-4281-b951-d872f2087c98
parent 33cfe7da
......@@ -55,4 +55,25 @@ IN_PROC_BROWSER_TEST_F(WebKitBrowserTest, XsltBadImport) {
EXPECT_FALSE(shell()->web_contents()->IsCrashed());
}
// This is a browser test because DumpRenderTree has a PrerendererClient
// implementation, and the purpose of this test is to ensure that content_shell
// does not crash when prerender elements are encountered with no Prererering
// implementation supplied to WebKit.
// TODO(gavinp,jochen): This browser_test depends on there not being a
// prerendering client and prerendering platform provided by the test_shell.
// But both will exist when we use content_shell to run layout tests. We must
// then add a mechanism to start content_shell without these, or else this
// test is not very interesting.
const char kPrerenderNoCrashPage[] =
"files/prerender/prerender-no-crash.html";
IN_PROC_BROWSER_TEST_F(WebKitBrowserTest, PrerenderNoCrash) {
ASSERT_TRUE(test_server()->Start());
GURL url = test_server()->GetURL(kPrerenderNoCrashPage);
NavigateToURL(shell(), url);
EXPECT_FALSE(shell()->web_contents()->IsCrashed());
}
} // namespace content
<html>
<head>
<title>This page should not crash</title>
</head>
<body>
<h1>Prerendering Page</h1>
<p>The content tests do not have a PrerenderingClient, but they should nevertheless
not crash. This test provides a prerendering link to insure the content shell
won't crash when handling a prerender link. It shouldn't actually prerender,
either.
<link rel=prerender href="does-not-exist.html">
</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