OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/shell_integration_linux.h" | 5 #include "chrome/browser/shell_integration_linux.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cstdlib> | 10 #include <cstdlib> |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 }; | 647 }; |
648 | 648 |
649 for (size_t i = 0; i < arraysize(test_cases); i++) { | 649 for (size_t i = 0; i < arraysize(test_cases); i++) { |
650 SCOPED_TRACE(i); | 650 SCOPED_TRACE(i); |
651 EXPECT_EQ(test_cases[i].expected_output, | 651 EXPECT_EQ(test_cases[i].expected_output, |
652 GetDirectoryFileContents(base::ASCIIToUTF16(test_cases[i].title), | 652 GetDirectoryFileContents(base::ASCIIToUTF16(test_cases[i].title), |
653 test_cases[i].icon_name)); | 653 test_cases[i].icon_name)); |
654 } | 654 } |
655 } | 655 } |
656 | 656 |
| 657 TEST(ShellIntegrationTest, WmClass) { |
| 658 base::CommandLine command_line((base::FilePath())); |
| 659 EXPECT_EQ("foo", internal::GetProgramClassName(command_line, "foo.desktop")); |
| 660 EXPECT_EQ("Foo", internal::GetProgramClassClass(command_line, "foo.desktop")); |
| 661 |
| 662 command_line.AppendSwitchASCII("class", "baR"); |
| 663 EXPECT_EQ("foo", internal::GetProgramClassName(command_line, "foo.desktop")); |
| 664 EXPECT_EQ("baR", internal::GetProgramClassClass(command_line, "foo.desktop")); |
| 665 |
| 666 command_line = base::CommandLine(base::FilePath()); |
| 667 command_line.AppendSwitchASCII("user-data-dir", "/tmp/baz"); |
| 668 EXPECT_EQ("foo (/tmp/baz)", |
| 669 internal::GetProgramClassName(command_line, "foo.desktop")); |
| 670 EXPECT_EQ("Foo", internal::GetProgramClassClass(command_line, "foo.desktop")); |
| 671 } |
| 672 |
657 } // namespace shell_integration_linux | 673 } // namespace shell_integration_linux |
OLD | NEW |