summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-10 18:02:51 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-10 18:02:51 +0000
commit136152270f3344c1da4d7cff2b25cc93911128e4 (patch)
treefa885043a1fb4a4ef940283151774bab1bc438f1
parent3618b6a1c9d8b9925af4988587b2c3e77055ae39 (diff)
downloadchromium_src-136152270f3344c1da4d7cff2b25cc93911128e4.zip
chromium_src-136152270f3344c1da4d7cff2b25cc93911128e4.tar.gz
chromium_src-136152270f3344c1da4d7cff2b25cc93911128e4.tar.bz2
Add FaviconOfOnloadRedirectToAnchorPage for issue 15782
BUG=15782 TEST=None Review URL: http://codereview.chromium.org/418006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34258 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browser_browsertest.cc17
-rwxr-xr-xchrome/test/data/onload_redirect_to_anchor.html14
2 files changed, 31 insertions, 0 deletions
diff --git a/chrome/browser/browser_browsertest.cc b/chrome/browser/browser_browsertest.cc
index 958bfb0..756b7dc 100644
--- a/chrome/browser/browser_browsertest.cc
+++ b/chrome/browser/browser_browsertest.cc
@@ -271,3 +271,20 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcut) {
ui_test_utils::NavigateToURL(browser(), blank_url);
EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS));
}
+
+// Test RenderView correctly send back favicon url for web page that redirects
+// to an anchor in javascript body.onload handler.
+IN_PROC_BROWSER_TEST_F(BrowserTest, FaviconOfOnloadRedirectToAnchorPage) {
+ static const wchar_t kDocRoot[] = L"chrome/test/data";
+ scoped_refptr<HTTPTestServer> server(
+ HTTPTestServer::CreateServer(kDocRoot, NULL));
+ ASSERT_TRUE(NULL != server.get());
+ GURL url(server->TestServerPage("files/onload_redirect_to_anchor.html"));
+ GURL expected_favicon_url(server->TestServerPage("files/test.png"));
+
+ ui_test_utils::NavigateToURL(browser(), url);
+
+ NavigationEntry* entry = browser()->GetSelectedTabContents()->
+ controller().GetActiveEntry();
+ EXPECT_EQ(expected_favicon_url.spec(), entry->favicon().url().spec());
+}
diff --git a/chrome/test/data/onload_redirect_to_anchor.html b/chrome/test/data/onload_redirect_to_anchor.html
new file mode 100755
index 0000000..e1e4128
--- /dev/null
+++ b/chrome/test/data/onload_redirect_to_anchor.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+<title></title>
+<link rel='icon' href='test.png'>
+<script type='text/javascript' language='javascript'>
+function OnLoad() {
+ window.location.href = '#test';
+}
+</script>
+</head>
+<body onload='OnLoad();'>
+<a name='test'>
+</body>
+</html> \ No newline at end of file