diff options
-rw-r--r-- | chrome/browser/automation/automation_provider.h | 3 | ||||
-rw-r--r-- | chrome/browser/automation/automation_provider_win.cc | 4 | ||||
-rw-r--r-- | chrome/test/automation/automation_messages_internal.h | 5 | ||||
-rw-r--r-- | chrome/test/automation/automation_proxy.cc | 4 | ||||
-rw-r--r-- | chrome_frame/cfproxy.h | 2 | ||||
-rw-r--r-- | chrome_frame/cfproxy_proxy.cc | 2 | ||||
-rw-r--r-- | chrome_frame/cfproxy_support.cc | 6 | ||||
-rw-r--r-- | chrome_frame/cfproxy_test.cc | 26 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_activex_base.h | 13 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_automation.cc | 10 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_automation.h | 8 | ||||
-rw-r--r-- | chrome_frame/chrome_tab.idl | 12 | ||||
-rw-r--r-- | chrome_frame/custom_sync_call_context.h | 7 | ||||
-rw-r--r-- | chrome_frame/external_tab.cc | 8 | ||||
-rw-r--r-- | chrome_frame/external_tab.h | 5 | ||||
-rw-r--r-- | chrome_frame/external_tab_test.cc | 9 | ||||
-rw-r--r-- | chrome_frame/test/automation_client_mock.cc | 19 |
17 files changed, 103 insertions, 40 deletions
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index 5a29b04..ff3b355 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -357,7 +357,8 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, void CreateExternalTab(const IPC::ExternalTabSettings& settings, gfx::NativeWindow* tab_container_window, gfx::NativeWindow* tab_window, - int* tab_handle); + int* tab_handle, + int* session_id); void ConnectExternalTab(uint64 cookie, bool allow, diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc index 7843c83..6420b56 100644 --- a/chrome/browser/automation/automation_provider_win.cc +++ b/chrome/browser/automation/automation_provider_win.cc @@ -241,12 +241,13 @@ void AutomationProvider::GetTabHWND(int handle, HWND* tab_hwnd) { void AutomationProvider::CreateExternalTab( const IPC::ExternalTabSettings& settings, gfx::NativeWindow* tab_container_window, gfx::NativeWindow* tab_window, - int* tab_handle) { + int* tab_handle, int* session_id) { TRACE_EVENT_BEGIN("AutomationProvider::CreateExternalTab", 0, ""); *tab_handle = 0; *tab_container_window = NULL; *tab_window = NULL; + *session_id = -1; scoped_refptr<ExternalTabContainer> external_tab_container = new ExternalTabContainer(this, automation_resource_message_filter_); @@ -266,6 +267,7 @@ void AutomationProvider::CreateExternalTab( *tab_handle = external_tab_container->tab_handle(); *tab_container_window = external_tab_container->GetNativeView(); *tab_window = tab_contents->GetNativeView(); + *session_id = tab_contents->controller().session_id().id(); } else { external_tab_container->Uninitialize(); } diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index adadf68..e8fd57f 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -428,11 +428,12 @@ IPC_BEGIN_MESSAGES(Automation) // hosted by an external process. // Request: // ExternalTabSettings - settings for external tab - IPC_SYNC_MESSAGE_ROUTED1_3(AutomationMsg_CreateExternalTab, + IPC_SYNC_MESSAGE_ROUTED1_4(AutomationMsg_CreateExternalTab, IPC::ExternalTabSettings /* settings*/, gfx::NativeWindow /* Tab container window */, gfx::NativeWindow /* Tab window */, - int /* Handle to the new tab */) + int /* Handle to the new tab */, + int /* Session Id of the new tab */) // This message notifies the AutomationProvider to navigate to a specified // url in the external tab with given handle. The first parameter is the diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc index 3f6eb64..748ffc2 100644 --- a/chrome/test/automation/automation_proxy.cc +++ b/chrome/test/automation/automation_proxy.cc @@ -487,11 +487,13 @@ scoped_refptr<TabProxy> AutomationProxy::CreateExternalTab( gfx::NativeWindow* external_tab_container, gfx::NativeWindow* tab) { int handle = 0; + int session_id = 0; bool succeeded = Send(new AutomationMsg_CreateExternalTab(0, settings, external_tab_container, tab, - &handle)); + &handle, + &session_id)); if (!succeeded) { return NULL; } diff --git a/chrome_frame/cfproxy.h b/chrome_frame/cfproxy.h index bfcc998..51c2153 100644 --- a/chrome_frame/cfproxy.h +++ b/chrome_frame/cfproxy.h @@ -157,7 +157,7 @@ class ChromeProxyDelegate { // Sync message responses. virtual void Completed_CreateTab(bool success, HWND chrome_wnd, - HWND tab_window, int tab_handle) = 0; + HWND tab_window, int tab_handle, int session_id) = 0; virtual void Completed_ConnectToTab(bool success, HWND chrome_window, HWND tab_window, int tab_handle) = 0; virtual void Completed_Navigate(bool success, diff --git a/chrome_frame/cfproxy_proxy.cc b/chrome_frame/cfproxy_proxy.cc index e03cb0e..c5c0b62 100644 --- a/chrome_frame/cfproxy_proxy.cc +++ b/chrome_frame/cfproxy_proxy.cc @@ -181,7 +181,7 @@ void CFProxy::Tab_Navigate(int tab, const GURL& url, const GURL& referrer) { void CFProxy::CreateTab(ChromeProxyDelegate* delegate, const IPC::ExternalTabSettings& p) { - IPC::SyncMessage* m = new AutomationMsg_CreateExternalTab(0, p, 0, 0, 0); + IPC::SyncMessage* m = new AutomationMsg_CreateExternalTab(0, p, 0, 0, 0, 0); sync_dispatcher_.QueueSyncMessage(m, delegate, NULL); SendIpcMessage(m); } diff --git a/chrome_frame/cfproxy_support.cc b/chrome_frame/cfproxy_support.cc index 42e6a28..004a2ea 100644 --- a/chrome_frame/cfproxy_support.cc +++ b/chrome_frame/cfproxy_support.cc @@ -20,7 +20,7 @@ void DispatchReplyFail(uint32 type, SyncMessageContext* ctx) { switch (type) { case AutomationMsg_CreateExternalTab::ID: - delegate->Completed_CreateTab(false, NULL, NULL, NULL); + delegate->Completed_CreateTab(false, NULL, NULL, 0, 0); break; case AutomationMsg_ConnectExternalTab::ID: delegate->Completed_ConnectToTab(false, NULL, NULL, NULL); @@ -38,12 +38,12 @@ bool DispatchReplyOk(const IPC::Message* reply_msg, uint32 type, void* iter = IPC::SyncMessage::GetDataIterator(reply_msg); switch (type) { case AutomationMsg_CreateExternalTab::ID: { - // Tuple3<HWND, HWND, int> out; + // Tuple4<HWND, HWND, int, int> out; TupleTypes<AutomationMsg_CreateExternalTab::ReplyParam>::ValueTuple out; if (ReadParam(reply_msg, &iter, &out)) { DCHECK(tab2delegate->find(out.c) == tab2delegate->end()); (*tab2delegate)[out.c] = delegate; - delegate->Completed_CreateTab(true, out.a, out.b, out.c); + delegate->Completed_CreateTab(true, out.a, out.b, out.c, out.d); } return true; } 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, diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h index def29b8..19c0ebf 100644 --- a/chrome_frame/chrome_frame_activex_base.h +++ b/chrome_frame/chrome_frame_activex_base.h @@ -166,6 +166,7 @@ class ATL_NO_VTABLE ChromeFrameActivexBase : // NOLINT public com_util::IProvideClassInfo2Impl<class_id, DIID_DIChromeFrameEvents>, public com_util::IDispatchImpl<IChromeFrame>, + public IChromeFrameInternal, public IConnectionPointContainerImpl<T>, public ProxyDIChromeFrameEvents<T>, public IPropertyNotifySinkCP<T>, @@ -200,6 +201,7 @@ DECLARE_NOT_AGGREGATABLE(T) BEGIN_COM_MAP(ChromeFrameActivexBase) COM_INTERFACE_ENTRY(IChromeFrame) COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(IChromeFrameInternal) COM_INTERFACE_ENTRY(IViewObjectEx) COM_INTERFACE_ENTRY(IViewObject2) COM_INTERFACE_ENTRY(IViewObject) @@ -889,6 +891,17 @@ END_MSG_MAP() return S_OK; } + STDMETHOD(getSessionId)(int* session_id) { + DCHECK(automation_client_.get()); + if (!is_privileged_) { + DLOG(ERROR) << "Attempt to getSessionId in non-privileged mode"; + return E_ACCESSDENIED; + } + + *session_id = automation_client_->GetSessionId(); + return (*session_id) == -1 ? S_FALSE : S_OK; + } + STDMETHOD(registerBhoIfNeeded)() { return E_NOTIMPL; } diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index 35f36e7..96c8d1e 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -571,6 +571,7 @@ ChromeFrameAutomationClient::ChromeFrameAutomationClient() proxy_factory_(g_proxy_factory.get()), handle_top_level_requests_(false), tab_handle_(-1), + session_id_(-1), external_tab_cookie_(0), url_fetcher_(NULL), url_fetcher_flags_(PluginUrlRequestManager::NOT_THREADSAFE), @@ -899,6 +900,10 @@ void ChromeFrameAutomationClient::GetEnabledExtensionsComplete( delete extension_directories; } +int ChromeFrameAutomationClient::GetSessionId() const { + return session_id_; +} + void ChromeFrameAutomationClient::OnChromeFrameHostMoved() { // Use a local var to avoid the small possibility of getting the tab_ // member be cleared while we try to use it. @@ -961,13 +966,13 @@ void ChromeFrameAutomationClient::CreateExternalTab() { 2); IPC::SyncMessage* message = - new AutomationMsg_CreateExternalTab(0, settings, NULL, NULL, NULL); + new AutomationMsg_CreateExternalTab(0, settings, NULL, NULL, 0, 0); automation_server_->SendAsAsync(message, new CreateExternalTabContext(this), this); } AutomationLaunchResult ChromeFrameAutomationClient::CreateExternalTabComplete( - HWND chrome_window, HWND tab_window, int tab_handle) { + HWND chrome_window, HWND tab_window, int tab_handle, int session_id) { if (!automation_server_) { // If we receive this notification while shutting down, do nothing. DLOG(ERROR) << "CreateExternalTabComplete called when automation server " @@ -984,6 +989,7 @@ AutomationLaunchResult ChromeFrameAutomationClient::CreateExternalTabComplete( tab_ = automation_server_->CreateTabProxy(tab_handle); tab_->AddObserver(this); tab_handle_ = tab_handle; + session_id_ = session_id; } return launch_result; } diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h index 47b03c0..cb1b282 100644 --- a/chrome_frame/chrome_frame_automation.h +++ b/chrome_frame/chrome_frame_automation.h @@ -364,6 +364,9 @@ class ChromeFrameAutomationClient void* user_data, std::vector<FilePath>* extension_directories); + // Returns the session ID used to identify a Tab in Chrome. + virtual int GetSessionId() const; + virtual void OnChromeFrameHostMoved(); TabProxy* tab() const { return tab_.get(); } @@ -458,7 +461,8 @@ class ChromeFrameAutomationClient void CreateExternalTab(); AutomationLaunchResult CreateExternalTabComplete(HWND chrome_window, HWND tab_window, - int tab_handle); + int tab_handle, + int session_id); // Called in UI thread. Here we fire event to the client notifying for // the result of Initialize() method call. void InitializeComplete(AutomationLaunchResult result); @@ -529,6 +533,8 @@ class ChromeFrameAutomationClient bool handle_top_level_requests_; ProxyFactory* proxy_factory_; int tab_handle_; + // The SessionId used by Chrome as the id in the Javascript Tab object. + int session_id_; // Only used if we attach to an existing tab. uint64 external_tab_cookie_; diff --git a/chrome_frame/chrome_tab.idl b/chrome_frame/chrome_tab.idl index f934673..7120910 100644 --- a/chrome_frame/chrome_tab.idl +++ b/chrome_frame/chrome_tab.idl @@ -84,13 +84,23 @@ interface IChromeFrame : IDispatch { }; [ + uuid(851bedec-4b2c-4959-abc0-a53403117257) +] +// Internal implementation interface. Not intended as an API. May change +// frequently, don't treat this as frozen. +interface IChromeFrameInternal : IUnknown { + // This method is available only when the control is in privileged mode. + HRESULT getSessionId([out, retval] int* session_id); +}; + +[ object, uuid(655A11E0-EF63-4fbe-9DF6-C182D2FCD6DC), oleautomation, nonextensible, hidden, ] -interface IChromeFramePrivileged: IUnknown { +interface IChromeFramePrivileged : IUnknown { // If the host returns false for wants_privileged, the control // won't enable privileged mode. HRESULT GetWantsPrivileged([out] boolean *wants_privileged); diff --git a/chrome_frame/custom_sync_call_context.h b/chrome_frame/custom_sync_call_context.h index 9cbe3d6..6162213 100644 --- a/chrome_frame/custom_sync_call_context.h +++ b/chrome_frame/custom_sync_call_context.h @@ -85,15 +85,16 @@ class GetEnabledExtensionsContext class CreateExternalTabContext : public SyncMessageReplyDispatcher::SyncMessageCallContext { public: - typedef Tuple3<HWND, HWND, int> output_type; + typedef Tuple4<HWND, HWND, int, int> output_type; explicit CreateExternalTabContext(ChromeFrameAutomationClient* client) : client_(client) { } - void Completed(HWND chrome_window, HWND tab_window, int tab_handle) { + void Completed(HWND chrome_window, HWND tab_window, int tab_handle, + int session_id) { AutomationLaunchResult launch_result = client_->CreateExternalTabComplete(chrome_window, tab_window, - tab_handle); + tab_handle, session_id); client_->PostTask(FROM_HERE, NewRunnableMethod( client_.get(), diff --git a/chrome_frame/external_tab.cc b/chrome_frame/external_tab.cc index 4bfeff2..7b6fe92 100644 --- a/chrome_frame/external_tab.cc +++ b/chrome_frame/external_tab.cc @@ -194,7 +194,8 @@ void ExternalTabProxy::ChromeFrameHostMoved() { ////////////////////////////////////////////////////////////////////////// void ExternalTabProxy::UiCompleted_CreateTab(bool success, HWND chrome_window, - HWND tab_window, int tab_handle) { + HWND tab_window, int tab_handle, + int session_id) { if (success) { state_ = READY; tab_ = tab_handle; @@ -210,11 +211,12 @@ void ExternalTabProxy::UiCompleted_CreateTab(bool success, HWND chrome_window, } void ExternalTabProxy::Completed_CreateTab(bool success, HWND chrome_wnd, - HWND tab_window, int tab_handle) { + HWND tab_window, int tab_handle, + int session_id) { // in ipc_thread. ui_.PostTask(FROM_HERE, NewRunnableMethod(this, &ExternalTabProxy::UiCompleted_CreateTab, - success, chrome_wnd, tab_window, tab_handle)); + success, chrome_wnd, tab_window, tab_handle, session_id)); } void ExternalTabProxy::Completed_ConnectToTab(bool success, diff --git a/chrome_frame/external_tab.h b/chrome_frame/external_tab.h index b68a9bf..707c701 100644 --- a/chrome_frame/external_tab.h +++ b/chrome_frame/external_tab.h @@ -126,8 +126,9 @@ class ExternalTabProxy : public CWindowImpl<ExternalTabProxy>, // Sync message responses. + // TODO(stoyan): Error_code virtual void Completed_CreateTab(bool success, HWND chrome_wnd, - HWND tab_window, int tab_handle); // TODO(stoyan): Error_code + HWND tab_window, int tab_handle, int session_id); virtual void Completed_ConnectToTab(bool success, HWND chrome_window, HWND tab_window, int tab_handle); virtual void Completed_Navigate(bool success, @@ -181,7 +182,7 @@ class ExternalTabProxy : public CWindowImpl<ExternalTabProxy>, void UiConnected(ChromeProxy* proxy); void UiPeerLost(ChromeProxy* proxy, DisconnectReason reason); void UiCompleted_CreateTab(bool success, HWND chrome_window, - HWND tab_window, int tab_handle); + HWND tab_window, int tab_handle, int session_id); // With the present state of affairs the only response we can possibly handle // in the background IPC thread is Completed_CreateTab() where we can diff --git a/chrome_frame/external_tab_test.cc b/chrome_frame/external_tab_test.cc index 0e49f95..375e4fb 100644 --- a/chrome_frame/external_tab_test.cc +++ b/chrome_frame/external_tab_test.cc @@ -133,10 +133,11 @@ struct AsyncEventCreator { } void Fire_CompletedCreateTab(bool success, HWND chrome_wnd, HWND tab_window, - int tab_handle, base::TimeDelta delay) { + int tab_handle, int session_id, + base::TimeDelta delay) { ipc_loop_->PostDelayedTask(FROM_HERE, NewRunnableMethod(delegate_, &ChromeProxyDelegate::Completed_CreateTab, success, chrome_wnd, - tab_window, tab_handle), delay.InMilliseconds()); + tab_window, tab_handle, session_id), delay.InMilliseconds()); } void Fire_TabLoaded(const GURL& url, base::TimeDelta delay) { @@ -173,7 +174,7 @@ TEST(ExternalTabProxy, CancelledCreateTab) { EXPECT_CALL(*proxy, RemoveDelegate(_)).WillOnce(DoAll( InvokeWithoutArgs(CreateFunctor(&async_events, &AsyncEventCreator::Fire_CompletedCreateTab, false, HWND(0), HWND(0), - 0, base::TimeDelta::FromMilliseconds(0))), + 0, 0, base::TimeDelta::FromMilliseconds(0))), InvokeWithoutArgs(CreateFunctor(&async_events, &AsyncEventCreator::Fire_Disconnected, base::TimeDelta::FromMilliseconds(0))), @@ -216,7 +217,7 @@ TEST(ExternalTabProxy, NavigateAfterCreate) { .WillOnce(DoAll( InvokeWithoutArgs(CreateFunctor(&async_events, &AsyncEventCreator::Fire_CompletedCreateTab, - true, HWND(0), HWND(0), 7, base::TimeDelta::FromMilliseconds(9))), + true, HWND(0), HWND(0), 7, 0, base::TimeDelta::FromMilliseconds(9))), InvokeWithoutArgs(CreateFunctor(&async_events, &AsyncEventCreator::Fire_TabLoaded, real_url, base::TimeDelta::FromMilliseconds(150))))); diff --git a/chrome_frame/test/automation_client_mock.cc b/chrome_frame/test/automation_client_mock.cc index a77b023..7e8f317 100644 --- a/chrome_frame/test/automation_client_mock.cc +++ b/chrome_frame/test/automation_client_mock.cc @@ -70,13 +70,15 @@ MATCHER_P(EqNavigationInfoUrl, url, "IPC::NavigationInfo matcher") { } // Could be implemented as MockAutomationProxy member (we have WithArgs<>!) -ACTION_P3(HandleCreateTab, tab_handle, external_tab_container, tab_wnd) { +ACTION_P4(HandleCreateTab, tab_handle, external_tab_container, tab_wnd, + session_id) { // arg0 - message // arg1 - callback // arg2 - key CreateExternalTabContext::output_type input_args(tab_wnd, external_tab_container, - tab_handle); + tab_handle, + session_id); CreateExternalTabContext* context = reinterpret_cast<CreateExternalTabContext*>(arg1); DispatchToMethod(context, &CreateExternalTabContext::Completed, input_args); @@ -253,7 +255,7 @@ TEST_F(CFACMockTest, MockedCreateTabOk) { EXPECT_CALL(mock_proxy_, SendAsAsync(testing::Property( &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab__ID), testing::NotNull(), _)) - .Times(1).WillOnce(HandleCreateTab(tab_handle_, h1, h2)); + .Times(1).WillOnce(HandleCreateTab(tab_handle_, h1, h2, 99)); EXPECT_CALL(mock_proxy_, CreateTabProxy(testing::Eq(tab_handle_))) .WillOnce(Return(tab_)); @@ -287,7 +289,8 @@ TEST_F(CFACMockTest, MockedCreateTabFailed) { EXPECT_CALL(mock_proxy_, SendAsAsync(testing::Property( &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab__ID), testing::NotNull(), _)) - .Times(1).WillOnce(HandleCreateTab(tab_handle_, null_wnd, null_wnd)); + .Times(1).WillOnce(HandleCreateTab(tab_handle_, null_wnd, null_wnd, + 99)); EXPECT_CALL(mock_proxy_, CreateTabProxy(_)).Times(0); @@ -348,9 +351,9 @@ TEST_F(CFACMockTest, OnChannelError) { EXPECT_CALL(proxy, SendAsAsync(testing::Property( &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab__ID), testing::NotNull(), _)).Times(3) - .WillOnce(HandleCreateTab(tab_handle_, h1, h2)) - .WillOnce(HandleCreateTab(tab_handle_ * 2, h1, h2)) - .WillOnce(HandleCreateTab(tab_handle_ * 3, h1, h2)); + .WillOnce(HandleCreateTab(tab_handle_, h1, h2, 99)) + .WillOnce(HandleCreateTab(tab_handle_ * 2, h1, h2, 100)) + .WillOnce(HandleCreateTab(tab_handle_ * 3, h1, h2, 101)); SetAutomationServerOk(3); @@ -428,7 +431,7 @@ TEST_F(CFACMockTest, NavigateTwiceAfterInitToSameUrl) { EXPECT_CALL(mock_proxy_, SendAsAsync(testing::Property( &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab__ID), testing::NotNull(), _)) - .Times(1).WillOnce(HandleCreateTab(tab_handle_, h1, h2)); + .Times(1).WillOnce(HandleCreateTab(tab_handle_, h1, h2, 99)); EXPECT_CALL(mock_proxy_, CreateTabProxy(testing::Eq(tab_handle_))) .WillOnce(Return(tab_)); |