win: Fix crashpad_util_test ProcessInfo.Handles

This new test from 7de04b02f85d was failing on Windows 10. I started by
adding the hint, which produced “CreateFileMapping: Access is denied.
(0x5)”. Switching the “Global\” to “Local\” fixes the test for me.

TEST=crashpad_util_test ProcessInfo.Handles
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/1407993003 .
This commit is contained in:
Mark Mentovai 2015-10-19 13:40:50 -04:00
parent 07dbc3259c
commit 1818dbbb08

View File

@ -25,6 +25,7 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "test/errors.h"
#include "test/scoped_temp_dir.h" #include "test/scoped_temp_dir.h"
#include "test/paths.h" #include "test/paths.h"
#include "test/win/child_launcher.h" #include "test/win/child_launcher.h"
@ -553,7 +554,7 @@ TEST(ProcessInfo, Handles) {
ASSERT_TRUE(scoped_key.is_valid()); ASSERT_TRUE(scoped_key.is_valid());
std::wstring mapping_name = std::wstring mapping_name =
base::UTF8ToUTF16(base::StringPrintf("Global\\test_mapping_%d_%I64x", base::UTF8ToUTF16(base::StringPrintf("Local\\test_mapping_%d_%I64x",
GetCurrentProcessId(), GetCurrentProcessId(),
base::RandUint64())); base::RandUint64()));
ScopedKernelHANDLE mapping(CreateFileMapping(INVALID_HANDLE_VALUE, ScopedKernelHANDLE mapping(CreateFileMapping(INVALID_HANDLE_VALUE,
@ -562,7 +563,7 @@ TEST(ProcessInfo, Handles) {
0, 0,
1024, 1024,
mapping_name.c_str())); mapping_name.c_str()));
ASSERT_TRUE(mapping.is_valid()); ASSERT_TRUE(mapping.is_valid()) << ErrorMessage("CreateFileMapping");
ProcessInfo info; ProcessInfo info;
info.Initialize(GetCurrentProcess()); info.Initialize(GetCurrentProcess());