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

Unified Diff: chrome/browser/shell_integration_linux_unittest.cc

Issue 2186813002: Linux: Support the --class argument (Reland) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add internal namespace Created 4 years, 5 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_linux_unittest.cc
diff --git a/chrome/browser/shell_integration_linux_unittest.cc b/chrome/browser/shell_integration_linux_unittest.cc
index d6a7120a60cf04f6d0c3313ef64be998757e6d7b..ec9037c320dd186ce2ad0c077db8fd4a6ccb2143 100644
--- a/chrome/browser/shell_integration_linux_unittest.cc
+++ b/chrome/browser/shell_integration_linux_unittest.cc
@@ -654,4 +654,20 @@ TEST(ShellIntegrationTest, GetDirectoryFileContents) {
}
}
+TEST(ShellIntegrationTest, WmClass) {
+ base::CommandLine command_line((base::FilePath()));
+ EXPECT_EQ(internal::GetProgramClassName(command_line, "foo.desktop"), "foo");
Lei Zhang 2016/07/28 21:28:46 EXPECT_EQ(expected_val, actual_val)
Tom (Use chromium acct) 2016/07/28 23:02:13 Done.
+ EXPECT_EQ(internal::GetProgramClassClass(command_line, "foo.desktop"), "Foo");
+
+ command_line.AppendSwitchASCII("class", "baR");
+ EXPECT_EQ(internal::GetProgramClassName(command_line, "foo.desktop"), "foo");
+ EXPECT_EQ(internal::GetProgramClassClass(command_line, "foo.desktop"), "baR");
+
+ command_line = base::CommandLine(base::FilePath());
+ command_line.AppendSwitchASCII("user-data-dir", "/tmp/baz");
+ EXPECT_EQ(internal::GetProgramClassName(command_line, "foo.desktop"),
+ "foo (/tmp/baz)");
+ EXPECT_EQ(internal::GetProgramClassClass(command_line, "foo.desktop"), "Foo");
+}
+
} // namespace shell_integration_linux

Powered by Google App Engine
This is Rietveld 408576698