OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_TEST_MOCK_RENDER_THREAD_H_ | 5 #ifndef CONTENT_TEST_MOCK_RENDER_THREAD_H_ |
6 #define CONTENT_TEST_MOCK_RENDER_THREAD_H_ | 6 #define CONTENT_TEST_MOCK_RENDER_THREAD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
10 #include "content/public/renderer/render_thread.h" | 10 #include "content/public/renderer/render_thread.h" |
(...skipping 11 matching lines...) Expand all Loading... | |
22 // ViewHostMsg_CreateWidget : sync message sent by the Widget. | 22 // ViewHostMsg_CreateWidget : sync message sent by the Widget. |
23 // ViewMsg_Close : async, send to the Widget. | 23 // ViewMsg_Close : async, send to the Widget. |
24 class MockRenderThread : public content::RenderThread { | 24 class MockRenderThread : public content::RenderThread { |
25 public: | 25 public: |
26 MockRenderThread(); | 26 MockRenderThread(); |
27 virtual ~MockRenderThread(); | 27 virtual ~MockRenderThread(); |
28 | 28 |
29 // Provides access to the messages that have been received by this thread. | 29 // Provides access to the messages that have been received by this thread. |
30 IPC::TestSink& sink() { return sink_; } | 30 IPC::TestSink& sink() { return sink_; } |
31 | 31 |
32 // Helpers for embedders to know when content IPC messages are received, since | |
33 // they don't have access to content IPC files. | |
34 void VerifyRunJavaScriptMessageSend(const string16& expected_alert_message); | |
tfarina
2011/12/05 01:17:43
can we include string16.h for it?
jam
2011/12/05 03:20:42
Done.
| |
35 | |
32 // content::RenderThread implementation: | 36 // content::RenderThread implementation: |
33 virtual bool Send(IPC::Message* msg) OVERRIDE; | 37 virtual bool Send(IPC::Message* msg) OVERRIDE; |
34 virtual MessageLoop* GetMessageLoop() OVERRIDE; | 38 virtual MessageLoop* GetMessageLoop() OVERRIDE; |
35 virtual IPC::SyncChannel* GetChannel() OVERRIDE; | 39 virtual IPC::SyncChannel* GetChannel() OVERRIDE; |
36 virtual std::string GetLocale() OVERRIDE; | 40 virtual std::string GetLocale() OVERRIDE; |
37 virtual void AddRoute(int32 routing_id, | 41 virtual void AddRoute(int32 routing_id, |
38 IPC::Channel::Listener* listener) OVERRIDE; | 42 IPC::Channel::Listener* listener) OVERRIDE; |
39 virtual void RemoveRoute(int32 routing_id) OVERRIDE; | 43 virtual void RemoveRoute(int32 routing_id) OVERRIDE; |
40 virtual int GenerateRoutingID() OVERRIDE; | 44 virtual int GenerateRoutingID() OVERRIDE; |
41 virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter) OVERRIDE; | 45 virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter) OVERRIDE; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 // adds a new route. | 117 // adds a new route. |
114 IPC::Channel::Listener* widget_; | 118 IPC::Channel::Listener* widget_; |
115 | 119 |
116 // The last known good deserializer for sync messages. | 120 // The last known good deserializer for sync messages. |
117 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; | 121 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; |
118 }; | 122 }; |
119 | 123 |
120 } // namespace content | 124 } // namespace content |
121 | 125 |
122 #endif // CONTENT_TEST_MOCK_RENDER_THREAD_H_ | 126 #endif // CONTENT_TEST_MOCK_RENDER_THREAD_H_ |
OLD | NEW |