posix: use threadsafe gtest death test for ScopedGuardedPage

Also update gyp to build it.

Change-Id: I859c552b9cfc41f531ffb04fe6d6730dbd0e8fed
Reviewed-on: https://chromium-review.googlesource.com/c/1319269
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Joshua Peraza 2018-11-06 12:54:37 -08:00 committed by Commit Bot
parent fdfd782c9b
commit bf10ed0a69
4 changed files with 6 additions and 1 deletions

View File

@ -23,6 +23,8 @@ namespace test {
namespace {
TEST(ScopedGuardedPage, BasicFunctionality) {
::testing::FLAGS_gtest_death_test_style = "threadsafe";
ScopedGuardedPage page;
char* address = (char*)page.Pointer();
EXPECT_NE(address, nullptr);

View File

@ -63,6 +63,8 @@
'multiprocess_posix.cc',
'process_type.cc',
'process_type.h',
'scoped_guarded_page.h',
'scoped_guarded_page_posix.cc',
'scoped_module_handle.cc',
'scoped_module_handle.h',
'scoped_temp_dir.cc',

View File

@ -39,6 +39,7 @@
'main_arguments_test.cc',
'multiprocess_exec_test.cc',
'multiprocess_posix_test.cc',
'scoped_guarded_page_test.cc',
'scoped_temp_dir_test.cc',
'test_paths_test.cc',
'win/win_child_process_test.cc',

View File

@ -55,7 +55,7 @@ TEST(ProcessMemoryRange, Basic) {
#elif defined(OS_WIN)
ProcessMemoryWin memory;
ASSERT_TRUE(memory.Initialize(GetCurrentProcess()));
#elif defined(OS_LINUX)
#elif defined(OS_LINUX) || defined(OS_ANDROID)
ProcessMemoryLinux memory;
ASSERT_TRUE(memory.Initialize(getpid()));
#endif // OS_FUCHSIA