Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: chrome/browser/shell_integration_unittest.cc

Issue 14383003: Application shortcuts in Linux are now installed into a "Chrome Apps" folder. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: GetDirectoryFileContents needs the same \n hack as GetDesktopFileContents. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/shell_integration_unittest.cc
diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc
index 5424c799e930b845f1ff765a2e21d3ac6188aba3..274537fc827169eb959fca41beb4164f4c61b747 100644
--- a/chrome/browser/shell_integration_unittest.cc
+++ b/chrome/browser/shell_integration_unittest.cc
@@ -471,4 +471,43 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) {
}
}
+TEST(ShellIntegrationTest, GetDirectoryFileContents) {
+ const struct {
+ const char* title;
+ const char* icon_name;
+ const char* expected_output;
+ } test_cases[] = {
+ // Real-world case.
+ { "Chrome Apps",
+ "chrome-apps",
+
+ "[Desktop Entry]\n"
+ "Version=1.0\n"
+ "Type=Directory\n"
+ "Name=Chrome Apps\n"
+ "Icon=chrome-apps\n"
+ },
+
+ // Make sure that empty icons are replaced by the chrome icon.
+ { "Chrome Apps",
+ "",
+
+ "[Desktop Entry]\n"
+ "Version=1.0\n"
+ "Type=Directory\n"
+ "Name=Chrome Apps\n"
+ "Icon=chromium-browser\n"
+ },
+ };
+
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); i++) {
+ SCOPED_TRACE(i);
+ EXPECT_EQ(
+ test_cases[i].expected_output,
+ ShellIntegrationLinux::GetDirectoryFileContents(
+ ASCIIToUTF16(test_cases[i].title),
+ test_cases[i].icon_name));
+ }
+}
+
#endif
« no previous file with comments | « chrome/browser/shell_integration_linux.cc ('k') | chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698