summaryrefslogtreecommitdiffstats
path: root/content/test/mock_render_thread.h
diff options
context:
space:
mode:
authorcreis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-15 18:42:04 +0000
committercreis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-15 18:42:04 +0000
commit744c2a2d90c3c9a33c818e1ea4b7ccb5010663a0 (patch)
tree1671691e79cab4bd2ba5339137145adda5eeeb55 /content/test/mock_render_thread.h
parentb553de8ad8058d912e997ab5182433b7506afce6 (diff)
downloadchromium_src-744c2a2d90c3c9a33c818e1ea4b7ccb5010663a0.zip
chromium_src-744c2a2d90c3c9a33c818e1ea4b7ccb5010663a0.tar.gz
chromium_src-744c2a2d90c3c9a33c818e1ea4b7ccb5010663a0.tar.bz2
Allow browser to handle all WebUI navigations.
BUG=113496 TEST="Google Dashboard" link in Sync settings loads in new process. Review URL: http://codereview.chromium.org/9663045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test/mock_render_thread.h')
-rw-r--r--content/test/mock_render_thread.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/content/test/mock_render_thread.h b/content/test/mock_render_thread.h
index d89ea73..120fa16 100644
--- a/content/test/mock_render_thread.h
+++ b/content/test/mock_render_thread.h
@@ -12,6 +12,8 @@
#include "ipc/ipc_test_sink.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h"
+struct ViewHostMsg_CreateWindow_Params;
+
namespace IPC {
class MessageReplyDeserializer;
}
@@ -19,8 +21,9 @@ class MessageReplyDeserializer;
namespace content {
// This class is a very simple mock of RenderThread. It simulates an IPC channel
-// which supports only two messages:
+// which supports only three messages:
// ViewHostMsg_CreateWidget : sync message sent by the Widget.
+// ViewHostMsg_CreateWindow : sync message sent by the Widget.
// ViewMsg_Close : async, send to the Widget.
class MockRenderThread : public content::RenderThread {
public:
@@ -91,6 +94,10 @@ class MockRenderThread : public content::RenderThread {
return widget_ ? true : false;
}
+ void set_new_window_routing_id(int32 id) {
+ new_window_routing_id_ = id;
+ }
+
// Simulates the Widget receiving a close message. This should result
// on releasing the internal reference counts and destroying the internal
// state.
@@ -107,6 +114,15 @@ class MockRenderThread : public content::RenderThread {
int* route_id,
int* surface_id);
+ // The View expects to be returned a valid route_id different from its own.
+ // We do not keep track of the newly created widget in MockRenderThread,
+ // so it must be cleaned up on its own.
+ void OnMsgCreateWindow(
+ const ViewHostMsg_CreateWindow_Params& params,
+ int* route_id,
+ int* surface_id,
+ int64* cloned_session_storage_namespace_id);
+
#if defined(OS_WIN)
void OnDuplicateSection(base::SharedMemoryHandle renderer_handle,
base::SharedMemoryHandle* browser_handle);
@@ -124,9 +140,13 @@ class MockRenderThread : public content::RenderThread {
int32 opener_id_;
// We only keep track of one Widget, we learn its pointer when it
- // adds a new route.
+ // adds a new route. We do not keep track of Widgets created with
+ // OnMsgCreateWindow.
IPC::Channel::Listener* widget_;
+ // Routing id that will be assigned to a CreateWindow Widget.
+ int32 new_window_routing_id_;
+
// The last known good deserializer for sync messages.
scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_;
};