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

Side by Side 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: Revert gtk2_util.cc Created 4 years, 4 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/shell_integration_linux.cc ('k') | chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698