diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-29 17:25:27 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-29 17:25:27 +0000 |
commit | 03c47326b78cb675b084efa829f350e45d5272d9 (patch) | |
tree | 7c8d01e37a0b99d45b5186060b2d3b5c12ca8c89 /testing/multiprocess_func_list.h | |
parent | 0afcb5672d2ec6d7c1250c474b7665de713b1b6d (diff) | |
download | chromium_src-03c47326b78cb675b084efa829f350e45d5272d9.zip chromium_src-03c47326b78cb675b084efa829f350e45d5272d9.tar.gz chromium_src-03c47326b78cb675b084efa829f350e45d5272d9.tar.bz2 |
Let RenderProcessHost provide a method HasConnection() instead of exposing
channel().
Motivation:
Currently, components that are using RenderProcessHost are checking its
liveness by null testing on channel(). I'd like to write unittests for those
components, but to mock out RenderProcessHost instances, I have to also
mock out the instance returned by RenderProcessHost::channel(), but there's
no interface class prepared. SyncChannel is directly used in RenderProcessHost.
Instead of dependency injection, I can let mock objects return invalid pointer
such as 0x1, but its bad test design. Rather than that, I'd like to introduce
HasConnection() method and override it to return true.
In fact, most of those components are not accessing channel()'s methods
directry. They're just checking channel() is null or not, and to issue IPCs,
they are calling Send method. So, it's OK to hide channel pointer from users, I
think.
Original review: http://codereview.chromium.org/147077
Patch by tyoshino@google.com
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19493 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing/multiprocess_func_list.h')
0 files changed, 0 insertions, 0 deletions