summaryrefslogtreecommitdiffstats
path: root/chrome/browser/shell_integration_unittest.cc
diff options
context:
space:
mode:
authormgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-08 08:11:59 +0000
committermgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-08 08:11:59 +0000
commit165b1ef4ba7a57b8af5f88b9f810527be078c427 (patch)
treec2ea3d22a18eb41f9b5ed081118fc88058362ec8 /chrome/browser/shell_integration_unittest.cc
parent8b911a6348da167cdef93ddda352fb964d6aedf6 (diff)
downloadchromium_src-165b1ef4ba7a57b8af5f88b9f810527be078c427.zip
chromium_src-165b1ef4ba7a57b8af5f88b9f810527be078c427.tar.gz
chromium_src-165b1ef4ba7a57b8af5f88b9f810527be078c427.tar.bz2
Fixed crash creating shortcuts on Linux with invalid desktop template file.
BUG=180799 Review URL: https://chromiumcodereview.appspot.com/12575002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186921 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/shell_integration_unittest.cc')
-rw-r--r--chrome/browser/shell_integration_unittest.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc
index 58b4294..30df2d4 100644
--- a/chrome/browser/shell_integration_unittest.cc
+++ b/chrome/browser/shell_integration_unittest.cc
@@ -391,6 +391,27 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) {
// Dumb case.
{ "ignored", "ignored", "ignored", false, "", "#!/usr/bin/env xdg-open\n" },
+ // Non-empty file without [Desktop Entry].
+ // This tests a different code path to the above.
+ { "http://gmail.com",
+ "GMail",
+ "chrome-http__gmail.com",
+ false,
+ "\n",
+
+ // The resulting shortcut is not useful, but we just want to make sure
+ // this doesn't crash.
+ "#!/usr/bin/env xdg-open\n"
+ "[Desktop Entry]\n"
+ "Name=GMail\n"
+ "Icon=chrome-http__gmail.com\n"
+#if !defined(USE_AURA)
+ // Aura Chrome does not (yet) set WMClass, so we only expect
+ // StartupWMClass on non-Aura builds.
+ "StartupWMClass=gmail.com\n"
+#endif
+ },
+
// Real-world case.
{ "http://gmail.com",
"GMail",