From 1818dbbb0851527281a281622b36a742664baa3f Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Mon, 19 Oct 2015 13:40:50 -0400 Subject: [PATCH] win: Fix crashpad_util_test ProcessInfo.Handles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 . --- util/win/process_info_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/win/process_info_test.cc b/util/win/process_info_test.cc index 4a8a209f..925d0062 100644 --- a/util/win/process_info_test.cc +++ b/util/win/process_info_test.cc @@ -25,6 +25,7 @@ #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "gtest/gtest.h" +#include "test/errors.h" #include "test/scoped_temp_dir.h" #include "test/paths.h" #include "test/win/child_launcher.h" @@ -553,7 +554,7 @@ TEST(ProcessInfo, Handles) { ASSERT_TRUE(scoped_key.is_valid()); std::wstring mapping_name = - base::UTF8ToUTF16(base::StringPrintf("Global\\test_mapping_%d_%I64x", + base::UTF8ToUTF16(base::StringPrintf("Local\\test_mapping_%d_%I64x", GetCurrentProcessId(), base::RandUint64())); ScopedKernelHANDLE mapping(CreateFileMapping(INVALID_HANDLE_VALUE, @@ -562,7 +563,7 @@ TEST(ProcessInfo, Handles) { 0, 1024, mapping_name.c_str())); - ASSERT_TRUE(mapping.is_valid()); + ASSERT_TRUE(mapping.is_valid()) << ErrorMessage("CreateFileMapping"); ProcessInfo info; info.Initialize(GetCurrentProcess());