summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/renderer_host/mock_render_process_host.cc4
-rw-r--r--chrome/common/ipc_test_sink.cc5
-rw-r--r--chrome/common/ipc_test_sink.h5
-rw-r--r--chrome/renderer/mock_render_thread.cc12
-rw-r--r--chrome/renderer/mock_render_thread.h4
-rw-r--r--chrome/renderer/pepper_devices_unittest.cc27
-rw-r--r--ipc/ipc_channel.h7
7 files changed, 9 insertions, 55 deletions
diff --git a/chrome/browser/renderer_host/mock_render_process_host.cc b/chrome/browser/renderer_host/mock_render_process_host.cc
index 7319c99..b18cc50 100644
--- a/chrome/browser/renderer_host/mock_render_process_host.cc
+++ b/chrome/browser/renderer_host/mock_render_process_host.cc
@@ -73,14 +73,14 @@ bool MockRenderProcessHost::FastShutdownIfPossible() {
bool MockRenderProcessHost::SendWithTimeout(IPC::Message* msg, int timeout_ms) {
// Save the message in the sink. Just ignore timeout_ms.
- sink_.Send(msg);
+ sink_.OnMessageReceived(*msg);
delete msg;
return true;
}
bool MockRenderProcessHost::Send(IPC::Message* msg) {
// Save the message in the sink.
- sink_.Send(msg);
+ sink_.OnMessageReceived(*msg);
delete msg;
return true;
}
diff --git a/chrome/common/ipc_test_sink.cc b/chrome/common/ipc_test_sink.cc
index 2979e6a..6a0e45b 100644
--- a/chrome/common/ipc_test_sink.cc
+++ b/chrome/common/ipc_test_sink.cc
@@ -12,9 +12,8 @@ TestSink::TestSink() {
TestSink::~TestSink() {
}
-bool TestSink::Send(Message* msg) {
- messages_.push_back(Message(*msg));
- return true;
+void TestSink::OnMessageReceived(const Message& msg) {
+ messages_.push_back(Message(msg));
}
void TestSink::ClearMessages() {
diff --git a/chrome/common/ipc_test_sink.h b/chrome/common/ipc_test_sink.h
index 056cb4c..973fc71 100644
--- a/chrome/common/ipc_test_sink.h
+++ b/chrome/common/ipc_test_sink.h
@@ -10,7 +10,6 @@
#include "base/basictypes.h"
#include "ipc/ipc_message.h"
-#include "ipc/ipc_channel.h"
namespace IPC {
@@ -41,14 +40,14 @@ namespace IPC {
//
// To hook up the sink, all you need to do is call OnMessageReceived when a
// message is received.
-class TestSink : public IPC::Channel {
+class TestSink {
public:
TestSink();
~TestSink();
// Used by the source of the messages to send the message to the sink. This
// will make a copy of the message and store it in the list.
- virtual bool Send(Message* message);
+ void OnMessageReceived(const Message& msg);
// Returns the number of messages in the queue.
size_t message_count() const { return messages_.size(); }
diff --git a/chrome/renderer/mock_render_thread.cc b/chrome/renderer/mock_render_thread.cc
index 35383cb..1fa513f 100644
--- a/chrome/renderer/mock_render_thread.cc
+++ b/chrome/renderer/mock_render_thread.cc
@@ -34,16 +34,6 @@ void MockRenderThread::RemoveRoute(int32 routing_id) {
widget_ = NULL;
}
-// Called by, for example, RenderView::Init(), when adding a new message filter
-void MockRenderThread::AddFilter(IPC::ChannelProxy::MessageFilter* filter) {
- filter->OnFilterAdded(&sink());
-}
-
-// Called when the filter is removed
-void MockRenderThread::RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) {
- filter->OnFilterRemoved();
-}
-
// Called by the Widget. Used to send messages to the browser.
// We short-circuit the mechanim and handle the messages right here on this
// class.
@@ -76,7 +66,7 @@ void MockRenderThread::SendCloseMessage() {
void MockRenderThread::OnMessageReceived(const IPC::Message& msg) {
// Save the message in the sink.
- sink_.Send(const_cast<IPC::Message*>(&msg));
+ sink_.OnMessageReceived(msg);
// Some messages we do special handling.
bool handled = true;
diff --git a/chrome/renderer/mock_render_thread.h b/chrome/renderer/mock_render_thread.h
index 24d646e..4f3b1d9 100644
--- a/chrome/renderer/mock_render_thread.h
+++ b/chrome/renderer/mock_render_thread.h
@@ -41,8 +41,8 @@ class MockRenderThread : public RenderThreadBase {
virtual bool Send(IPC::Message* msg);
// Our mock thread doesn't do filtering.
- virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter);
- virtual void RemoveFilter(IPC::ChannelProxy::MessageFilter* filter);
+ virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter) { }
+ virtual void RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) { }
// Our mock thread doesn't deal with hidden and restored tabs.
virtual void WidgetHidden() { }
diff --git a/chrome/renderer/pepper_devices_unittest.cc b/chrome/renderer/pepper_devices_unittest.cc
index d7d2a6e..b793a4e 100644
--- a/chrome/renderer/pepper_devices_unittest.cc
+++ b/chrome/renderer/pepper_devices_unittest.cc
@@ -117,9 +117,6 @@ class PepperDeviceTest : public RenderViewTest {
NPError err,
NPUserData* user_data);
- // Audio callback, currently empty.
- static void AudioCallback(NPDeviceContextAudio* context);
-
// A log of flush commands we can use to check the async callbacks.
struct FlushData {
NPP instance;
@@ -221,10 +218,6 @@ void PepperDeviceTest::FlushCalled(NPP instance,
that->flush_calls_.push_back(flush_data);
}
-void PepperDeviceTest::AudioCallback(NPDeviceContextAudio* context) {
-}
-
-
// -----------------------------------------------------------------------------
// TODO(brettw) this crashes on Mac. Figure out why and enable.
@@ -257,23 +250,3 @@ TEST_F(PepperDeviceTest, Flush) {
EXPECT_EQ(1u, flush_calls_.size());
}
#endif
-
-TEST_F(PepperDeviceTest, AudioInit) {
- NPDeviceContextAudioConfig config;
- config.sampleRate = NPAudioSampleRate44100Hz;
- config.sampleType = NPAudioSampleTypeInt16;
- config.outputChannelMap = NPAudioChannelStereo;
- config.callback = &AudioCallback;
- config.userData = this;
- NPDeviceContextAudio context;
- EXPECT_EQ(NPERR_NO_ERROR,
- pepper_plugin()->DeviceAudioInitializeContext(&config, &context));
- EXPECT_TRUE(render_thread_.sink().GetFirstMessageMatching(
- ViewHostMsg_CreateAudioStream::ID));
- EXPECT_EQ(0, memcmp(&config, &context.config, sizeof(config)));
- EXPECT_EQ(NPERR_NO_ERROR,
- pepper_plugin()->DeviceAudioDestroyContext(&context));
- EXPECT_TRUE(render_thread_.sink().GetFirstMessageMatching(
- ViewHostMsg_CloseAudioStream::ID));
-}
-
diff --git a/ipc/ipc_channel.h b/ipc/ipc_channel.h
index 8468d7c..a7a9a34 100644
--- a/ipc/ipc_channel.h
+++ b/ipc/ipc_channel.h
@@ -96,13 +96,6 @@ class Channel : public Message::Sender {
int GetClientFileDescriptor() const;
#endif // defined(OS_POSIX)
- protected:
- // Used in Chrome by the TestSink to provide a dummy channel implementation
- // for testing. TestSink overrides the "interesting" functions in Channel so
- // no actual implementation is needed. This will cause un-overridden calls to
- // segfault. Do not use outside of test code!
- Channel() : channel_impl_(0) { }
-
private:
// PIMPL to which all channel calls are delegated.
class ChannelImpl;