summaryrefslogtreecommitdiffstats
path: root/chrome_frame/cfproxy_test.cc
diff options
context:
space:
mode:
authorhansl@google.com <hansl@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-28 16:05:36 +0000
committerhansl@google.com <hansl@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-28 16:05:36 +0000
commitd57b6ab5930b827b56d412b1d334620c91e8cdbd (patch)
tree7ec5d9867db431d3a89092fcebd2327078c64c16 /chrome_frame/cfproxy_test.cc
parent8073fb0ca593e537c75d1b40b7206b4f58434d86 (diff)
downloadchromium_src-d57b6ab5930b827b56d412b1d334620c91e8cdbd.zip
chromium_src-d57b6ab5930b827b56d412b1d334620c91e8cdbd.tar.gz
chromium_src-d57b6ab5930b827b56d412b1d334620c91e8cdbd.tar.bz2
The ChromeFrame objects now provides an unfrozen interface called IChromeFramePrivate. This interface provides a GetSessionId() which returns the ID used by Chrome in its Tab javascript object.
Review URL: http://codereview.chromium.org/3541017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64252 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/cfproxy_test.cc')
-rw-r--r--chrome_frame/cfproxy_test.cc26
1 files changed, 20 insertions, 6 deletions
diff --git a/chrome_frame/cfproxy_test.cc b/chrome_frame/cfproxy_test.cc
index 28ba8c6..566a398 100644
--- a/chrome_frame/cfproxy_test.cc
+++ b/chrome_frame/cfproxy_test.cc
@@ -33,8 +33,8 @@ struct MockChromeProxyDelegate : public ChromeProxyDelegate {
MOCK_METHOD0(Disconnected, void());
MOCK_METHOD0(tab_handle, int());
- MOCK_METHOD4(Completed_CreateTab, void(bool success, HWND chrome_wnd,
- HWND tab_window, int tab_handle));
+ MOCK_METHOD5(Completed_CreateTab, void(bool success, HWND chrome_wnd,
+ HWND tab_window, int tab_handle, int session_id));
MOCK_METHOD4(Completed_ConnectToTab, void(bool success, HWND chrome_window,
HWND tab_window, int tab_handle));
MOCK_METHOD2(Completed_Navigate, void(bool success,
@@ -316,7 +316,16 @@ inline IPC::Message* CreateReply(M* m, const A& a, const B& b, const C& c) {
}
return r;
}
-} // namespace
+
+template <typename M, typename A, typename B, typename C, typename D>
+inline IPC::Message* CreateReply(M* m, const A& a, const B& b, const C& c,
+ const D& d) {
+ IPC::Message* r = IPC::SyncMessage::GenerateReply(m);
+ if (r) {
+ M::WriteReplyParams(r, a, b, c, d);
+ }
+ return r;
+}} // namespace
DISABLE_RUNNABLE_METHOD_REFCOUNT(SyncMsgSender);
TEST(SyncMsgSender, Deserialize) {
@@ -329,12 +338,16 @@ TEST(SyncMsgSender, Deserialize) {
TabsMap tab2delegate;
SyncMsgSender queue(&tab2delegate);
+ const int kTabHandle = 6;
+ const int kSessionId = 8;
+
// Create some sync messages and their replies.
AutomationMsg_InstallExtension m1(0, FilePath(L"c:\\awesome.x"), 0);
- AutomationMsg_CreateExternalTab m2(0, IPC::ExternalTabSettings(), 0, 0, 0);
+ AutomationMsg_CreateExternalTab m2(0, IPC::ExternalTabSettings(), 0, 0, 0, 0);
scoped_ptr<IPC::Message> r1(CreateReply(&m1,
AUTOMATION_MSG_EXTENSION_INSTALL_SUCCEEDED));
- scoped_ptr<IPC::Message> r2(CreateReply(&m2, (HWND)1, (HWND)2, 6));
+ scoped_ptr<IPC::Message> r2(CreateReply(&m2, (HWND)1, (HWND)2, kTabHandle,
+ kSessionId));
queue.QueueSyncMessage(&m1, &d1, NULL);
queue.QueueSyncMessage(&m2, &d1, NULL);
@@ -342,7 +355,8 @@ TEST(SyncMsgSender, Deserialize) {
testing::InSequence s;
EXPECT_CALL(d1, Completed_InstallExtension(true,
AUTOMATION_MSG_EXTENSION_INSTALL_SUCCEEDED, NULL));
- EXPECT_CALL(d1, Completed_CreateTab(true, (HWND)1, (HWND)2, 6));
+ EXPECT_CALL(d1, Completed_CreateTab(true, (HWND)1, (HWND)2, kTabHandle,
+ kSessionId));
// Execute replies in a worker thread.
ipc.message_loop()->PostTask(FROM_HERE, NewRunnableMethod(&queue,