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

Side by Side Diff: chrome_frame/chrome_launcher_unittest.cc

Issue 270062: Use ASCII strings for switch names. (Closed)
Patch Set: victory Created 11 years, 2 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
« no previous file with comments | « chrome/tools/crash_service/crash_service.cc ('k') | courgette/courgette_tool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "chrome/common/chrome_switches.h" 7 #include "chrome/common/chrome_switches.h"
8 #include "chrome_frame/chrome_launcher.h" 8 #include "chrome_frame/chrome_launcher.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 15 matching lines...) Expand all
26 private: 26 private:
27 int initial_log_level_; 27 int initial_log_level_;
28 }; 28 };
29 29
30 } // namespace 30 } // namespace
31 31
32 TEST(ChromeLauncher, SanitizeCommandLine) { 32 TEST(ChromeLauncher, SanitizeCommandLine) {
33 CommandLine bad(L"dummy.exe"); 33 CommandLine bad(L"dummy.exe");
34 bad.AppendSwitch(switches::kDisableMetrics); // in whitelist 34 bad.AppendSwitch(switches::kDisableMetrics); // in whitelist
35 bad.AppendSwitchWithValue(switches::kLoadExtension, L"foo"); // in whitelist 35 bad.AppendSwitchWithValue(switches::kLoadExtension, L"foo"); // in whitelist
36 bad.AppendSwitch(L"no-such-switch"); // does not exist 36 bad.AppendSwitch("no-such-switch"); // does not exist
37 bad.AppendSwitch(switches::kHomePage); // exists but not in whitelist 37 bad.AppendSwitch(switches::kHomePage); // exists but not in whitelist
38 38
39 LogDisabler no_dchecks; 39 LogDisabler no_dchecks;
40 40
41 CommandLine sanitized(L"dumbo.exe"); 41 CommandLine sanitized(L"dumbo.exe");
42 chrome_launcher::SanitizeCommandLine(bad, &sanitized); 42 chrome_launcher::SanitizeCommandLine(bad, &sanitized);
43 EXPECT_TRUE(sanitized.HasSwitch(switches::kDisableMetrics)); 43 EXPECT_TRUE(sanitized.HasSwitch(switches::kDisableMetrics));
44 EXPECT_TRUE(sanitized.HasSwitch(switches::kLoadExtension)); 44 EXPECT_TRUE(sanitized.HasSwitch(switches::kLoadExtension));
45 EXPECT_FALSE(sanitized.HasSwitch(L"no-such-switch")); 45 EXPECT_FALSE(sanitized.HasSwitch("no-such-switch"));
46 EXPECT_FALSE(sanitized.HasSwitch(switches::kHomePage)); 46 EXPECT_FALSE(sanitized.HasSwitch(switches::kHomePage));
47 47
48 EXPECT_EQ(sanitized.GetSwitchValue(switches::kLoadExtension), L"foo"); 48 EXPECT_EQ(sanitized.GetSwitchValue(switches::kLoadExtension), L"foo");
49 } 49 }
OLDNEW
« no previous file with comments | « chrome/tools/crash_service/crash_service.cc ('k') | courgette/courgette_tool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698