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

Unified Diff: util/win/process_info_test.cc

Issue 981393003: win: Support reading process info cross-bitness (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@64-port-test-2
Patch Set: Review feedback Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: util/win/process_info_test.cc
diff --git a/util/win/process_info_test.cc b/util/win/process_info_test.cc
index 386bd2f59065a7f3ba1ace717b3b23c83c3fda65..39294b8cd046c4059ebc4e49e58e978f35f4a71a 100644
--- a/util/win/process_info_test.cc
+++ b/util/win/process_info_test.cc
@@ -61,7 +61,7 @@ TEST(ProcessInfo, Self) {
modules[1].substr(modules[1].size() - wcslen(kNtdllName)));
}
-TEST(ProcessInfo, SomeOtherProcess) {
+void TestOtherProcess(const std::wstring& child_name_suffix) {
ProcessInfo process_info;
::UUID system_uuid;
@@ -80,7 +80,7 @@ TEST(ProcessInfo, SomeOtherProcess) {
base::FilePath test_executable = ExecutablePath();
std::wstring child_test_executable =
test_executable.RemoveFinalExtension().value() +
- L"_process_info_test_child.exe";
+ L"_process_info_test_child_" + child_name_suffix + L".exe";
// TODO(scottmg): Command line escaping utility.
std::wstring command_line = child_test_executable + L" " +
started_uuid.ToString16() + L" " +
@@ -113,10 +113,11 @@ TEST(ProcessInfo, SomeOtherProcess) {
std::vector<std::wstring> modules;
EXPECT_TRUE(process_info.Modules(&modules));
ASSERT_GE(modules.size(), 3u);
- const wchar_t kChildName[] = L"\\util_test_process_info_test_child.exe";
- ASSERT_GE(modules[0].size(), wcslen(kChildName));
- EXPECT_EQ(kChildName,
- modules[0].substr(modules[0].size() - wcslen(kChildName)));
+ std::wstring child_name =
+ L"\\util_test_process_info_test_child_" + child_name_suffix + L".exe";
+ ASSERT_GE(modules[0].size(), child_name.size());
+ EXPECT_EQ(child_name,
+ modules[0].substr(modules[0].size() - child_name.size()));
ASSERT_GE(modules[1].size(), wcslen(kNtdllName));
EXPECT_EQ(kNtdllName,
modules[1].substr(modules[1].size() - wcslen(kNtdllName)));
@@ -129,6 +130,14 @@ TEST(ProcessInfo, SomeOtherProcess) {
modules.back().substr(modules.back().size() - wcslen(kLz32dllName)));
}
+TEST(ProcessInfo, OtherProcessX64) {
+ TestOtherProcess(L"x64");
+}
+
+TEST(ProcessInfo, OtherProcessX86) {
+ TestOtherProcess(L"x86");
+}
+
} // namespace
} // namespace test
} // namespace crashpad

Powered by Google App Engine
This is Rietveld 408576698