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

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: rebase 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
« no previous file with comments | « util/win/process_info.cc ('k') | util/win/process_structs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/win/process_info_test.cc
diff --git a/util/win/process_info_test.cc b/util/win/process_info_test.cc
index 5b1b7995722af9b36bca75ffb30f3ccc41854e5f..38fd84a8c9a5999c883bc98cc62b99db97d67699 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 = Paths::Executable();
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,11 +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"\\crashpad_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"\\crashpad_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)));
@@ -130,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
« no previous file with comments | « util/win/process_info.cc ('k') | util/win/process_structs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698