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

In 2eeaa3ac549a, 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
parent 827e045279
commit 82ffeaa0f0

View File

@ -538,12 +538,14 @@ 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$",
ScopedFileHandle inherited_file(CreateFile(
temp_dir.path().Append(FILE_PATH_LITERAL("inheritable")).value().c_str(),
GENERIC_WRITE,
0,
&security_attributes,
OPEN_EXISTING,
CREATE_NEW,
FILE_ATTRIBUTE_NORMAL,
nullptr));
ASSERT_TRUE(inherited_file.is_valid());