diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-27 17:26:58 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-27 17:26:58 +0000 |
commit | 5019ef1ab7f79f71fffabe14ab7ae9bfcb44daa8 (patch) | |
tree | b2a439da42c4bd6de2b8516428b065bdabaf129f /chrome/browser/browser_browsertest.cc | |
parent | 62e0dbdec1c30c929d7c6148372b153e9b1c1792 (diff) | |
download | chromium_src-5019ef1ab7f79f71fffabe14ab7ae9bfcb44daa8.zip chromium_src-5019ef1ab7f79f71fffabe14ab7ae9bfcb44daa8.tar.gz chromium_src-5019ef1ab7f79f71fffabe14ab7ae9bfcb44daa8.tar.bz2 |
Add support for new webkit capability allowing us to update
favicons when changed via Javascript.
BUG=none
TEST=BrowserTest.FaviconChange
Review URL: http://codereview.chromium.org/1747015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45713 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_browsertest.cc')
-rw-r--r-- | chrome/browser/browser_browsertest.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/browser_browsertest.cc b/chrome/browser/browser_browsertest.cc index 4abc544..ff2b40e 100644 --- a/chrome/browser/browser_browsertest.cc +++ b/chrome/browser/browser_browsertest.cc @@ -383,6 +383,25 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, FaviconOfOnloadRedirectToAnchorPage) { EXPECT_EQ(expected_favicon_url.spec(), entry->favicon().url().spec()); } +// Test that an icon can be changed from JS. +IN_PROC_BROWSER_TEST_F(BrowserTest, FaviconChange) { + static const FilePath::CharType* kFile = + FILE_PATH_LITERAL("onload_change_favicon.html"); + GURL file_url(ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory), + FilePath(kFile))); + ASSERT_TRUE(file_url.SchemeIs(chrome::kFileScheme)); + ui_test_utils::NavigateToURL(browser(), file_url); + + NavigationEntry* entry = browser()->GetSelectedTabContents()-> + controller().GetActiveEntry(); + static const FilePath::CharType* kIcon = + FILE_PATH_LITERAL("test1.png"); + GURL expected_favicon_url( + ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory), + FilePath(kIcon))); + EXPECT_EQ(expected_favicon_url.spec(), entry->favicon().url().spec()); +} + // TODO(sky): get these to run on a Mac. #if !defined(OS_MACOSX) IN_PROC_BROWSER_TEST_F(BrowserTest, PhantomTab) { |