diff options
author | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-17 17:59:14 +0000 |
---|---|---|
committer | raymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-17 17:59:14 +0000 |
commit | b75673feb9ba4b97e6e19aa62e19c642b4aaf7a9 (patch) | |
tree | 892450a947f9f5aea5dab4074c4bbdd38ace773c /ppapi/proxy/ppapi_proxy_test.cc | |
parent | 33be5e38df8aa19bbd40a639c2788fc048ec2783 (diff) | |
download | chromium_src-b75673feb9ba4b97e6e19aa62e19c642b4aaf7a9.zip chromium_src-b75673feb9ba4b97e6e19aa62e19c642b4aaf7a9.tar.gz chromium_src-b75673feb9ba4b97e6e19aa62e19c642b4aaf7a9.tar.bz2 |
Fix ppapi TwoWayTest so that it constructs a unique IPC::ChannelHandle.
When multiple TwoWayTests (run as ppapi_unittests) were run concurrently,
several IPC ChannelHandles may have been created with the same name. This would
cause the creation of the channel to fail (because the channel handle has to be
unique). This was causing flaky tests on the trybots. This uses the process ID
in the channel handle name so that they are guaranteed to be unique for the set
of running processes.
This also re-enables a test which I disabled under the suspiscion that it was
related to this failure (but it isn't).
BUG=155175
Review URL: https://chromiumcodereview.appspot.com/11196002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162458 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppapi_proxy_test.cc')
-rw-r--r-- | ppapi/proxy/ppapi_proxy_test.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ppapi/proxy/ppapi_proxy_test.cc b/ppapi/proxy/ppapi_proxy_test.cc index bf139bb..06658e3 100644 --- a/ppapi/proxy/ppapi_proxy_test.cc +++ b/ppapi/proxy/ppapi_proxy_test.cc @@ -4,10 +4,13 @@ #include "ppapi/proxy/ppapi_proxy_test.h" +#include <sstream> + #include "base/bind.h" #include "base/compiler_specific.h" #include "base/message_loop_proxy.h" #include "base/observer_list.h" +#include "base/process_util.h" #include "ipc/ipc_sync_channel.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/private/ppb_proxy_private.h" @@ -415,8 +418,11 @@ void TwoWayTest::SetUp() { io_thread_.StartWithOptions(options); plugin_thread_.Start(); - IPC::ChannelHandle handle; - handle.name = "TwoWayTestChannel"; + // Construct the IPC handle name using the process ID so we can safely run + // multiple |TwoWayTest|s concurrently. + std::ostringstream handle_name; + handle_name << "TwoWayTestChannel" << base::GetCurrentProcId(); + IPC::ChannelHandle handle(handle_name.str()); base::WaitableEvent remote_harness_set_up(true, false); plugin_thread_.message_loop_proxy()->PostTask( FROM_HERE, |