win: crashpad_util_test ProcessInfo.Handles doesn't work with CONOUT$

In 2eeaa3ac54, I added a check to make sure that the expected CONOUT$
handle was found. Its omission seemed to be unintentional. The tests
passed for me on Windows 10, but failed on the bots. I can reproduce
the failures locally on Windows 7.

Doing the inheritance test with a file other than CONOUT$ fixes the
immediate problem, but we should find out why this CONOUT$ handle isn't
showing up in the handles list on Windows 7, fix it, and add back a
test.

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/1428753009 .
This commit is contained in:
Mark Mentovai 2015-11-05 15:08:28 -05:00
Родитель 827e045279
Коммит 82ffeaa0f0
1 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -538,14 +538,16 @@ TEST(ProcessInfo, Handles) {
ASSERT_TRUE(file.is_valid());
SECURITY_ATTRIBUTES security_attributes = {0};
security_attributes.nLength = sizeof(security_attributes);
security_attributes.bInheritHandle = true;
ScopedFileHandle inherited_file(CreateFile(L"CONOUT$",
GENERIC_WRITE,
0,
&security_attributes,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
nullptr));
ScopedFileHandle inherited_file(CreateFile(
temp_dir.path().Append(FILE_PATH_LITERAL("inheritable")).value().c_str(),
GENERIC_WRITE,
0,
&security_attributes,
CREATE_NEW,
FILE_ATTRIBUTE_NORMAL,
nullptr));
ASSERT_TRUE(inherited_file.is_valid());
HKEY key;