summaryrefslogtreecommitdiffstats
path: root/chrome/browser/shell_integration_unittest.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 22:35:15 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 22:35:15 +0000
commit0b303cc493d3557b5a5e9e5c8dfc6bdc4953ee73 (patch)
tree807e7e57f0d329087bd1ba12baca7684f8553e5e /chrome/browser/shell_integration_unittest.cc
parent12636df0dcf36c769c8a5940d6a0c0b6b6a6647c (diff)
downloadchromium_src-0b303cc493d3557b5a5e9e5c8dfc6bdc4953ee73.zip
chromium_src-0b303cc493d3557b5a5e9e5c8dfc6bdc4953ee73.tar.gz
chromium_src-0b303cc493d3557b5a5e9e5c8dfc6bdc4953ee73.tar.bz2
Use favicon for application shortcut icon.
BUG=22528 Review URL: http://codereview.chromium.org/249023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27422 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/shell_integration_unittest.cc')
-rw-r--r--chrome/browser/shell_integration_unittest.cc30
1 files changed, 27 insertions, 3 deletions
diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc
index 3b01c30..4f8ddef 100644
--- a/chrome/browser/shell_integration_unittest.cc
+++ b/chrome/browser/shell_integration_unittest.cc
@@ -40,15 +40,17 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) {
const struct {
const char* url;
const char* title;
+ const char* icon_name;
const char* template_contents;
const char* expected_output;
} test_cases[] = {
// Dumb case.
- { "ignored", "ignored", "", "#!/usr/bin/env xdg-open\n" },
+ { "ignored", "ignored", "ignored", "", "#!/usr/bin/env xdg-open\n" },
// Real-world case.
{ "http://gmail.com",
"GMail",
+ "chrome-http__gmail.com",
"[Desktop Entry]\n"
"Version=1.0\n"
@@ -69,7 +71,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) {
"Name=GMail\n"
"Exec=/opt/google/chrome/google-chrome \"--app=http://gmail.com/\"\n"
"Terminal=false\n"
- "Icon=/opt/google/chrome/product_logo_48.png\n"
+ "Icon=chrome-http__gmail.com\n"
"Type=Application\n"
"Categories=Application;Network;WebBrowser;\n"
"MimeType=text/html;text/xml;application/xhtml_xml;\n"
@@ -78,6 +80,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) {
// Make sure we don't insert duplicate shebangs.
{ "http://gmail.com",
"GMail",
+ "chrome-http__gmail.com",
"#!/some/shebang\n"
"Name=Google Chrome\n"
@@ -91,6 +94,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) {
// Make sure i18n-ed comments are removed.
{ "http://gmail.com",
"GMail",
+ "chrome-http__gmail.com",
"Name=Google Chrome\n"
"Exec=/opt/google/chrome/google-chrome %U\n"
@@ -101,9 +105,26 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) {
"Exec=/opt/google/chrome/google-chrome \"--app=http://gmail.com/\"\n"
},
+ // Make sure that empty icons are replaced by the chrome icon.
+ { "http://gmail.com",
+ "GMail",
+ "",
+
+ "Name=Google Chrome\n"
+ "Exec=/opt/google/chrome/google-chrome %U\n"
+ "Comment[pl]=Jakis komentarz.\n"
+ "Icon=/opt/google/chrome/product_logo_48.png\n",
+
+ "#!/usr/bin/env xdg-open\n"
+ "Name=GMail\n"
+ "Exec=/opt/google/chrome/google-chrome \"--app=http://gmail.com/\"\n"
+ "Icon=/opt/google/chrome/product_logo_48.png\n"
+ },
+
// Now we're starting to be more evil...
{ "http://evil.com/evil --join-the-b0tnet",
"Ownz0red\nExec=rm -rf /",
+ "chrome-http__evil.com_evil",
"Name=Google Chrome\n"
"Exec=/opt/google/chrome/google-chrome %U\n",
@@ -115,6 +136,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) {
},
{ "http://evil.com/evil; rm -rf /; \"; rm -rf $HOME >ownz0red",
"Innocent Title",
+ "chrome-http__evil.com_evil",
"Name=Google Chrome\n"
"Exec=/opt/google/chrome/google-chrome %U\n",
@@ -127,6 +149,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) {
},
{ "http://evil.com/evil | cat `echo ownz0red` >/dev/null\\",
"Innocent Title",
+ "chrome-http__evil.com_evil",
"Name=Google Chrome\n"
"Exec=/opt/google/chrome/google-chrome %U\n",
@@ -143,7 +166,8 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) {
ShellIntegration::GetDesktopFileContents(
test_cases[i].template_contents,
GURL(test_cases[i].url),
- ASCIIToUTF16(test_cases[i].title)));
+ ASCIIToUTF16(test_cases[i].title),
+ test_cases[i].icon_name));
}
}
#endif // defined(OS_LINUX)