Chromium Code Reviews| Index: util/win/process_info_test.cc |
| diff --git a/util/win/process_info_test.cc b/util/win/process_info_test.cc |
| index ecae69f831f755543448ad4da3f016de3b2d100e..0ef7325fd95cbf4f209663e519b9b22c0fdaa111 100644 |
| --- a/util/win/process_info_test.cc |
| +++ b/util/win/process_info_test.cc |
| @@ -49,16 +49,17 @@ TEST(ProcessInfo, Self) { |
| EXPECT_TRUE(process_info.CommandLine(&command_line)); |
| EXPECT_EQ(std::wstring(GetCommandLine()), command_line); |
| - std::vector<std::wstring> modules; |
| + std::vector<ProcessInfo::Module> modules; |
| EXPECT_TRUE(process_info.Modules(&modules)); |
| ASSERT_GE(modules.size(), 2u); |
| const wchar_t kSelfName[] = L"\\crashpad_util_test.exe"; |
| - ASSERT_GE(modules[0].size(), wcslen(kSelfName)); |
| + ASSERT_GE(modules[0].name.size(), wcslen(kSelfName)); |
| EXPECT_EQ(kSelfName, |
| - modules[0].substr(modules[0].size() - wcslen(kSelfName))); |
| - ASSERT_GE(modules[1].size(), wcslen(kNtdllName)); |
| - EXPECT_EQ(kNtdllName, |
| - modules[1].substr(modules[1].size() - wcslen(kNtdllName))); |
| + modules[0].name.substr(modules[0].name.size() - wcslen(kSelfName))); |
| + ASSERT_GE(modules[1].name.size(), wcslen(kNtdllName)); |
| + EXPECT_EQ( |
| + kNtdllName, |
| + modules[1].name.substr(modules[1].name.size() - wcslen(kNtdllName))); |
|
Mark Mentovai
2015/04/29 19:37:16
Verify the sanity of the two other fields in Proce
scottmg
2015/04/30 03:31:32
Done.
|
| } |
| void TestOtherProcess(const std::wstring& child_name_suffix) { |
| @@ -110,24 +111,25 @@ void TestOtherProcess(const std::wstring& child_name_suffix) { |
| // Tell the test it's OK to shut down now that we've read our data. |
| SetEvent(done.get()); |
| - std::vector<std::wstring> modules; |
| + std::vector<ProcessInfo::Module> modules; |
| EXPECT_TRUE(process_info.Modules(&modules)); |
| ASSERT_GE(modules.size(), 3u); |
| 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()); |
| + ASSERT_GE(modules[0].name.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))); |
| + modules[0].name.substr(modules[0].name.size() - child_name.size())); |
| + ASSERT_GE(modules[1].name.size(), wcslen(kNtdllName)); |
| + EXPECT_EQ( |
| + kNtdllName, |
| + modules[1].name.substr(modules[1].name.size() - wcslen(kNtdllName))); |
| // lz32.dll is an uncommonly-used-but-always-available module that the test |
| // binary manually loads. |
| const wchar_t kLz32dllName[] = L"\\lz32.dll"; |
| - ASSERT_GE(modules.back().size(), wcslen(kLz32dllName)); |
| - EXPECT_EQ( |
| - kLz32dllName, |
| - modules.back().substr(modules.back().size() - wcslen(kLz32dllName))); |
| + ASSERT_GE(modules.back().name.size(), wcslen(kLz32dllName)); |
| + EXPECT_EQ(kLz32dllName, |
| + modules.back().name.substr(modules.back().name.size() - |
| + wcslen(kLz32dllName))); |
| } |
| TEST(ProcessInfo, OtherProcessX64) { |