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

Unified Diff: chrome/install_static/install_util_unittest.cc

Issue 2549593002: Revert of Make Crashpad use the user data dir, rather than always default location (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « chrome/install_static/install_util.cc ('k') | chrome/install_static/policy_path_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/install_static/install_util_unittest.cc
diff --git a/chrome/install_static/install_util_unittest.cc b/chrome/install_static/install_util_unittest.cc
index 59b5749f83bd8686c5bec494c40c4d0781d8d8ad..b09241f39eb64718fee10aa1029a2a9bfd6e8ca4 100644
--- a/chrome/install_static/install_util_unittest.cc
+++ b/chrome/install_static/install_util_unittest.cc
@@ -39,67 +39,65 @@
// Tests the install_static::GetSwitchValueFromCommandLine function.
TEST(InstallStaticTest, GetSwitchValueFromCommandLineTest) {
// Simple case with one switch.
- std::wstring value =
- GetSwitchValueFromCommandLine(L"c:\\temp\\bleh.exe --type=bar", L"type");
- EXPECT_EQ(L"bar", value);
+ std::string value =
+ GetSwitchValueFromCommandLine("c:\\temp\\bleh.exe --type=bar", "type");
+ EXPECT_EQ("bar", value);
// Multiple switches with trailing spaces between them.
value = GetSwitchValueFromCommandLine(
- L"c:\\temp\\bleh.exe --type=bar --abc=def bleh", L"abc");
- EXPECT_EQ(L"def", value);
+ "c:\\temp\\bleh.exe --type=bar --abc=def bleh", "abc");
+ EXPECT_EQ("def", value);
// Multiple switches with trailing spaces and tabs between them.
value = GetSwitchValueFromCommandLine(
- L"c:\\temp\\bleh.exe --type=bar \t\t\t --abc=def bleh", L"abc");
- EXPECT_EQ(L"def", value);
+ "c:\\temp\\bleh.exe --type=bar \t\t\t --abc=def bleh", "abc");
+ EXPECT_EQ("def", value);
// Non existent switch.
value = GetSwitchValueFromCommandLine(
- L"c:\\temp\\bleh.exe --foo=bar --abc=def bleh", L"type");
- EXPECT_EQ(L"", value);
+ "c:\\temp\\bleh.exe --foo=bar --abc=def bleh", "type");
+ EXPECT_EQ("", value);
// Non existent switch.
- value = GetSwitchValueFromCommandLine(L"c:\\temp\\bleh.exe", L"type");
- EXPECT_EQ(L"", value);
+ value = GetSwitchValueFromCommandLine("c:\\temp\\bleh.exe", "type");
+ EXPECT_EQ("", value);
// Non existent switch.
- value =
- GetSwitchValueFromCommandLine(L"c:\\temp\\bleh.exe type=bar", L"type");
- EXPECT_EQ(L"", value);
+ value = GetSwitchValueFromCommandLine("c:\\temp\\bleh.exe type=bar", "type");
+ EXPECT_EQ("", value);
// Trailing spaces after the switch.
value = GetSwitchValueFromCommandLine(
- L"c:\\temp\\bleh.exe --type=bar \t\t", L"type");
- EXPECT_EQ(L"bar", value);
+ "c:\\temp\\bleh.exe --type=bar \t\t", "type");
+ EXPECT_EQ("bar", value);
// Multiple switches with trailing spaces and tabs between them.
value = GetSwitchValueFromCommandLine(
- L"c:\\temp\\bleh.exe --type=bar \t\t --foo=bleh", L"foo");
- EXPECT_EQ(L"bleh", value);
+ "c:\\temp\\bleh.exe --type=bar \t\t --foo=bleh", "foo");
+ EXPECT_EQ("bleh", value);
// Nothing after a switch.
- value = GetSwitchValueFromCommandLine(L"c:\\temp\\bleh.exe --type=", L"type");
+ value = GetSwitchValueFromCommandLine("c:\\temp\\bleh.exe --type=", "type");
EXPECT_TRUE(value.empty());
// Whitespace after a switch.
- value =
- GetSwitchValueFromCommandLine(L"c:\\temp\\bleh.exe --type= ", L"type");
+ value = GetSwitchValueFromCommandLine("c:\\temp\\bleh.exe --type= ", "type");
EXPECT_TRUE(value.empty());
// Just tabs after a switch.
- value = GetSwitchValueFromCommandLine(L"c:\\temp\\bleh.exe --type=\t\t\t",
- L"type");
+ value = GetSwitchValueFromCommandLine("c:\\temp\\bleh.exe --type=\t\t\t",
+ "type");
EXPECT_TRUE(value.empty());
// Whitespace after the "=" before the value.
- value =
- GetSwitchValueFromCommandLine(L"c:\\temp\\bleh.exe --type= bar", L"type");
- EXPECT_EQ(L"bar", value);
+ value = GetSwitchValueFromCommandLine("c:\\temp\\bleh.exe --type= bar",
+ "type");
+ EXPECT_EQ("bar", value);
// Tabs after the "=" before the value.
- value = GetSwitchValueFromCommandLine(L"c:\\temp\\bleh.exe --type=\t\t\tbar",
- L"type");
- EXPECT_EQ(value, L"bar");
+ value = GetSwitchValueFromCommandLine("c:\\temp\\bleh.exe --type=\t\t\tbar",
+ "type");
+ EXPECT_EQ(value, "bar");
}
TEST(InstallStaticTest, BrowserProcessTest) {
@@ -275,6 +273,11 @@
expected += L"-m";
}
EXPECT_EQ(expected, GetChromeChannelName(true));
+}
+
+TEST_P(InstallStaticUtilTest, GetDefaultUserDataDirectory) {
+ std::wstring user_data_directory;
+ ASSERT_TRUE(GetDefaultUserDataDirectory(&user_data_directory));
}
#if defined(GOOGLE_CHROME_BUILD)
« no previous file with comments | « chrome/install_static/install_util.cc ('k') | chrome/install_static/policy_path_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698