Chromium Code Reviews| Index: ppapi/proxy/dispatcher.h |
| =================================================================== |
| --- ppapi/proxy/dispatcher.h (revision 72517) |
| +++ ppapi/proxy/dispatcher.h (working copy) |
| @@ -29,6 +29,7 @@ |
| namespace IPC { |
| class SyncChannel; |
| +class TestSink; |
| } |
| namespace pp { |
| @@ -65,6 +66,11 @@ |
| bool is_client, |
| base::WaitableEvent* shutdown_event); |
| + // Alternative to Init() for unit tests that want to send all messages sent |
|
viettrungluu
2011/01/27 16:52:58
Alternative to InitWithChannel()?
|
| + // via this dispatcher to the given test sink. The test sink must outlive |
| + // this class. |
| + void InitWithTestSink(IPC::TestSink* test_sink); |
| + |
| // Returns true if the dispatcher is on the plugin side, or false if it's the |
| // browser side. |
| virtual bool IsPlugin() const = 0; |
| @@ -104,6 +110,7 @@ |
| // IPC::Channel::Listener implementation. |
| virtual bool OnMessageReceived(const IPC::Message& msg); |
| + // Will be NULL in some unit tests. |
| IPC::SyncChannel* channel() const { |
| return channel_.get(); |
| } |
| @@ -164,6 +171,13 @@ |
| PP_Module pp_module_; |
| base::ProcessHandle remote_process_handle_; // See getter above. |
| + |
| + // When we're unit testing, this will indicate the sink for the messages to |
| + // be deposited so they can be inspected by the test. When non-NULL, this |
| + // indicates that the channel should not be used. |
| + IPC::TestSink* test_sink_; |
| + |
| + // Will be null for some tests when there is a test_sink_. |
| scoped_ptr<IPC::SyncChannel> channel_; |
| bool disallow_trusted_interfaces_; |