Fix CrossProcessNotificationMultiProcessTest.Basic on Android.

On Android the ashmem API is used to deal with shared memory. This API doesn't
provide any way to open a memory region created by another process for security
reasons. The only way to share memory on Android is to share the underlying
file descriptor between processes.
This can be accomplished by:
- Creating a new shared memory region in a process. Note that this region can
  be anonymous (i.e. the string provided to ashmem_create_region() can be
  empty).
- Forking and keeping open both in the parent and child processes the file
  descriptor corresponding to the previously created memory region.
- Doing an mmap() in both processes (nothing special here).

The unit test was deadlocking (stuck in the while loop in the child process)
since the call to CreateNamed() wasn't opening the existing shared memory
region (created by the parent process) but was actually creating a new shared
memory region.
This means that the two processes were actually seeing different memory
regions.

Since this also works on POSIX platforms, the unit test was modified to follow
this strategy on all POSIX systems (including Android). On Windows the old
strategy (using non-anonymous shared memory) is still used.

BUG=136720


Review URL: https://chromiumcodereview.appspot.com/11299159

git-svn-id: http://src.chromium.org/svn/trunk/src/build@169662 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
pliard@chromium.org 2012-11-27 15:47:17 +00:00
Родитель f221468601
Коммит 54e0576113
1 изменённых файлов: 0 добавлений и 3 удалений

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

@ -1,8 +1,5 @@
# List of suppressions
# crbug.com/136720
CrossProcessNotificationMultiProcessTest.Basic
# Death tests are not supported on APK
# http://crbug.com/138855
CompositeFilterDeathTest.*