From 165b1ef4ba7a57b8af5f88b9f810527be078c427 Mon Sep 17 00:00:00 2001 From: "mgiuca@chromium.org" Date: Fri, 8 Mar 2013 08:11:59 +0000 Subject: 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 --- chrome/browser/shell_integration_unittest.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'chrome/browser/shell_integration_unittest.cc') 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", -- cgit v1.1