Index: chrome/browser/shell_integration_linux_unittest.cc |
diff --git a/chrome/browser/shell_integration_linux_unittest.cc b/chrome/browser/shell_integration_linux_unittest.cc |
index d1f1816edaffe23f44886e1946507544fddafb07..cdfd247c58f1654532973c6db71fe758c89ca12e 100644 |
--- a/chrome/browser/shell_integration_linux_unittest.cc |
+++ b/chrome/browser/shell_integration_linux_unittest.cc |
@@ -446,6 +446,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) { |
const char* url; |
const char* title; |
const char* icon_name; |
+ const char* categories; |
bool nodisplay; |
const char* expected_output; |
} test_cases[] = { |
@@ -453,6 +454,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) { |
{ "http://gmail.com", |
"GMail", |
"chrome-http__gmail.com", |
+ "", |
false, |
"#!/usr/bin/env xdg-open\n" |
@@ -470,6 +472,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) { |
{ "http://gmail.com", |
"GMail", |
"", |
+ "", |
false, |
"#!/usr/bin/env xdg-open\n" |
@@ -487,10 +490,11 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) { |
"StartupWMClass=gmail.com\n" |
}, |
- // Test adding NoDisplay=true. |
+ // Test adding categories and NoDisplay=true. |
{ "http://gmail.com", |
"GMail", |
"chrome-http__gmail.com", |
+ "Graphics;Education;", |
true, |
"#!/usr/bin/env xdg-open\n" |
@@ -501,6 +505,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) { |
"Name=GMail\n" |
"Exec=/opt/google/chrome/google-chrome --app=http://gmail.com/\n" |
"Icon=chrome-http__gmail.com\n" |
+ "Categories=Graphics;Education;\n" |
"NoDisplay=true\n" |
"StartupWMClass=gmail.com\n" |
}, |
@@ -509,6 +514,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) { |
{ "http://evil.com/evil --join-the-b0tnet", |
"Ownz0red\nExec=rm -rf /", |
"chrome-http__evil.com_evil", |
+ "", |
false, |
"#!/usr/bin/env xdg-open\n" |
@@ -525,6 +531,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) { |
{ "http://evil.com/evil; rm -rf /; \"; rm -rf $HOME >ownz0red", |
"Innocent Title", |
"chrome-http__evil.com_evil", |
+ "", |
false, |
"#!/usr/bin/env xdg-open\n" |
@@ -546,6 +553,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) { |
{ "http://evil.com/evil | cat `echo ownz0red` >/dev/null", |
"Innocent Title", |
"chrome-http__evil.com_evil", |
+ "", |
false, |
"#!/usr/bin/env xdg-open\n" |
@@ -575,6 +583,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) { |
base::ASCIIToUTF16(test_cases[i].title), |
test_cases[i].icon_name, |
base::FilePath(), |
+ test_cases[i].categories, |
test_cases[i].nodisplay)); |
} |
} |
@@ -592,6 +601,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContentsAppList) { |
"Name=Chrome App Launcher\n" |
"Exec=/opt/google/chrome/google-chrome --show-app-list\n" |
"Icon=chrome_app_list\n" |
+ "Categories=Network;WebBrowser;\n" |
"StartupWMClass=chrome-app-list\n", |
ShellIntegrationLinux::GetDesktopFileContentsForCommand( |
command_line, |
@@ -599,6 +609,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContentsAppList) { |
GURL(), |
base::ASCIIToUTF16("Chrome App Launcher"), |
"chrome_app_list", |
+ "Network;WebBrowser;", |
false)); |
} |