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

Side by Side Diff: chrome/browser/shell_integration_linux_unittest.cc

Issue 2230203002: chrome: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed accidental components/ change 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 28 matching lines...) Expand all
39 // Provides mock environment variables values based on a stored map. 39 // Provides mock environment variables values based on a stored map.
40 class MockEnvironment : public base::Environment { 40 class MockEnvironment : public base::Environment {
41 public: 41 public:
42 MockEnvironment() {} 42 MockEnvironment() {}
43 43
44 void Set(base::StringPiece name, const std::string& value) { 44 void Set(base::StringPiece name, const std::string& value) {
45 variables_[name.as_string()] = value; 45 variables_[name.as_string()] = value;
46 } 46 }
47 47
48 bool GetVar(base::StringPiece variable_name, std::string* result) override { 48 bool GetVar(base::StringPiece variable_name, std::string* result) override {
49 if (ContainsKey(variables_, variable_name.as_string())) { 49 if (base::ContainsKey(variables_, variable_name.as_string())) {
50 *result = variables_[variable_name.as_string()]; 50 *result = variables_[variable_name.as_string()];
51 return true; 51 return true;
52 } 52 }
53 53
54 return false; 54 return false;
55 } 55 }
56 56
57 bool SetVar(base::StringPiece variable_name, 57 bool SetVar(base::StringPiece variable_name,
58 const std::string& new_value) override { 58 const std::string& new_value) override {
59 ADD_FAILURE(); 59 ADD_FAILURE();
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 EXPECT_EQ("baR", internal::GetProgramClassClass(command_line, "foo.desktop")); 664 EXPECT_EQ("baR", internal::GetProgramClassClass(command_line, "foo.desktop"));
665 665
666 command_line = base::CommandLine(base::FilePath()); 666 command_line = base::CommandLine(base::FilePath());
667 command_line.AppendSwitchASCII("user-data-dir", "/tmp/baz"); 667 command_line.AppendSwitchASCII("user-data-dir", "/tmp/baz");
668 EXPECT_EQ("foo (/tmp/baz)", 668 EXPECT_EQ("foo (/tmp/baz)",
669 internal::GetProgramClassName(command_line, "foo.desktop")); 669 internal::GetProgramClassName(command_line, "foo.desktop"));
670 EXPECT_EQ("Foo", internal::GetProgramClassClass(command_line, "foo.desktop")); 670 EXPECT_EQ("Foo", internal::GetProgramClassClass(command_line, "foo.desktop"));
671 } 671 }
672 672
673 } // namespace shell_integration_linux 673 } // namespace shell_integration_linux
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_restore.cc ('k') | chrome/browser/signin/easy_unlock_service_signin_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698