Index: chrome/test/automation/automation_proxy_uitest.cc |
=================================================================== |
--- chrome/test/automation/automation_proxy_uitest.cc (revision 69966) |
+++ chrome/test/automation/automation_proxy_uitest.cc (working copy) |
@@ -642,15 +642,15 @@ |
} |
void ExternalTabUITestMockClient::ReplyStarted( |
- const IPC::AutomationURLResponse* response, |
+ const AutomationURLResponse* response, |
int tab_handle, int request_id) { |
- AutomationProxy::Send(new AutomationMsg_RequestStarted(0, tab_handle, |
+ AutomationProxy::Send(new AutomationMsg_RequestStarted(tab_handle, |
request_id, *response)); |
} |
void ExternalTabUITestMockClient::ReplyData( |
const std::string* data, int tab_handle, int request_id) { |
- AutomationProxy::Send(new AutomationMsg_RequestData(0, tab_handle, |
+ AutomationProxy::Send(new AutomationMsg_RequestData(tab_handle, |
request_id, *data)); |
} |
@@ -660,13 +660,13 @@ |
void ExternalTabUITestMockClient::ReplyEnd(const URLRequestStatus& status, |
int tab_handle, int request_id) { |
- AutomationProxy::Send(new AutomationMsg_RequestEnd(0, tab_handle, |
+ AutomationProxy::Send(new AutomationMsg_RequestEnd(tab_handle, |
request_id, status)); |
} |
void ExternalTabUITestMockClient::Reply404(int tab_handle, int request_id) { |
- const IPC::AutomationURLResponse notfound("", "HTTP/1.1 404\r\n\r\n", 0, |
- base::Time(), "", 0); |
+ const AutomationURLResponse notfound("", "HTTP/1.1 404\r\n\r\n", 0, |
+ base::Time(), "", 0); |
ReplyStarted(¬found, tab_handle, request_id); |
ReplyEOF(tab_handle, request_id); |
} |
@@ -674,29 +674,29 @@ |
void ExternalTabUITestMockClient::ServeHTMLData(int tab_handle, |
const GURL& url, |
const std::string& data) { |
- EXPECT_CALL(*this, OnRequestStart(tab_handle, _, testing::AllOf( |
- testing::Field(&IPC::AutomationURLRequest::url, url.spec()), |
- testing::Field(&IPC::AutomationURLRequest::method, StrEq("GET"))))) |
+ EXPECT_CALL(*this, OnRequestStart(tab_handle, testing::AllOf( |
+ testing::Field(&AutomationURLRequest::url, url.spec()), |
+ testing::Field(&AutomationURLRequest::method, StrEq("GET"))))) |
.Times(1) |
- .WillOnce(testing::WithArgs<0, 1>(testing::Invoke(CreateFunctor(this, |
+ .WillOnce(testing::WithArgs<0, 0>(testing::Invoke(CreateFunctor(this, |
&ExternalTabUITestMockClient::ReplyStarted, &http_200)))); |
- EXPECT_CALL(*this, OnRequestRead(tab_handle, _, testing::Gt(0))) |
+ EXPECT_CALL(*this, OnRequestRead(tab_handle, testing::Gt(0))) |
.Times(2) |
- .WillOnce(testing::WithArgs<0, 1>(testing::Invoke(CreateFunctor(this, |
+ .WillOnce(testing::WithArgs<0, 0>(testing::Invoke(CreateFunctor(this, |
&ExternalTabUITestMockClient::ReplyData, &data)))) |
- .WillOnce(testing::WithArgs<0, 1>(testing::Invoke(CreateFunctor(this, |
+ .WillOnce(testing::WithArgs<0, 0>(testing::Invoke(CreateFunctor(this, |
&ExternalTabUITestMockClient::ReplyEOF)))); |
} |
void ExternalTabUITestMockClient::IgnoreFavIconNetworkRequest() { |
// Ignore favicon.ico |
- EXPECT_CALL(*this, OnRequestStart(_, _, testing::AllOf( |
- testing::Field(&IPC::AutomationURLRequest::url, |
+ EXPECT_CALL(*this, OnRequestStart(_, testing::AllOf( |
+ testing::Field(&AutomationURLRequest::url, |
testing::EndsWith("favicon.ico")), |
- testing::Field(&IPC::AutomationURLRequest::method, StrEq("GET"))))) |
+ testing::Field(&AutomationURLRequest::method, StrEq("GET"))))) |
.Times(testing::AnyNumber()) |
- .WillRepeatedly(testing::WithArgs<0, 1>(testing::Invoke( |
+ .WillRepeatedly(testing::WithArgs<0, 0>(testing::Invoke( |
CreateFunctor(this, &ExternalTabUITestMockClient::ReplyEnd, |
URLRequestStatus(URLRequestStatus::FAILED, 0))))); |
} |
@@ -713,7 +713,7 @@ |
} |
// Most of the time we need external tab with these settings. |
-const IPC::ExternalTabSettings ExternalTabUITestMockClient::default_settings( |
+const ExternalTabSettings ExternalTabUITestMockClient::default_settings( |
NULL, gfx::Rect(), // will be replaced by CreateHostWindowAndTab |
WS_CHILD | WS_VISIBLE, |
false, // is_off_the_record |
@@ -725,7 +725,7 @@ |
false); // route_all_top_level_navigations |
// static |
-const IPC::AutomationURLResponse ExternalTabUITestMockClient::http_200( |
+const AutomationURLResponse ExternalTabUITestMockClient::http_200( |
"", |
"HTTP/0.9 200\r\n\r\n", |
0, |
@@ -746,12 +746,12 @@ |
IPC_MESSAGE_HANDLER(AutomationMsg_AttachExternalTab, OnAttachExternalTab) |
IPC_MESSAGE_HANDLER(AutomationMsg_OpenURL, OnOpenURL) |
IPC_MESSAGE_HANDLER(AutomationMsg_NavigationStateChanged, |
- OnNavigationStateChanged) |
+ OnNavigationStateChanged) |
IPC_END_MESSAGE_MAP() |
} |
scoped_refptr<TabProxy> ExternalTabUITestMockClient::CreateHostWindowAndTab( |
- const IPC::ExternalTabSettings& settings) { |
+ const ExternalTabSettings& settings) { |
EXPECT_THAT(settings.parent, testing::IsNull()); |
host_window_ = CreateWindowW(L"Button", NULL, host_window_style_, |
@@ -761,7 +761,7 @@ |
RECT client_area = {0}; |
::GetClientRect(host_window_, &client_area); |
- IPC::ExternalTabSettings s = settings; |
+ ExternalTabSettings s = settings; |
s.parent = host_window_; |
s.dimensions = client_area; |
@@ -777,7 +777,7 @@ |
scoped_refptr<TabProxy> ExternalTabUITestMockClient::CreateTabWithUrl( |
const GURL& initial_url) { |
- IPC::ExternalTabSettings settings = |
+ ExternalTabSettings settings = |
ExternalTabUITestMockClient::default_settings; |
settings.initial_url = initial_url; |
return CreateHostWindowAndTab(settings); |
@@ -785,25 +785,25 @@ |
void ExternalTabUITestMockClient::NavigateInExternalTab(int tab_handle, |
const GURL& url, const GURL& referrer /* = GURL()*/) { |
- channel_->ChannelProxy::Send(new AutomationMsg_NavigateInExternalTab(0, |
+ channel_->ChannelProxy::Send(new AutomationMsg_NavigateInExternalTab( |
tab_handle, url, referrer, NULL)); |
} |
void ExternalTabUITestMockClient::ConnectToExternalTab(gfx::NativeWindow parent, |
- const IPC::AttachExternalTabParams& attach_params) { |
+ const AttachExternalTabParams& attach_params) { |
gfx::NativeWindow tab_container = NULL; |
gfx::NativeWindow tab_window = NULL; |
int tab_handle = 0; |
int session_id = -1; |
- IPC::SyncMessage* message = new AutomationMsg_ConnectExternalTab(0, |
+ IPC::SyncMessage* message = new AutomationMsg_ConnectExternalTab( |
attach_params.cookie, true, NULL, &tab_container, &tab_window, |
&tab_handle, &session_id); |
channel_->Send(message); |
RECT rect; |
::GetClientRect(parent, &rect); |
- IPC::Reposition_Params params = {0}; |
+ Reposition_Params params = {0}; |
params.window = tab_container; |
params.flags = SWP_NOZORDER | SWP_SHOWWINDOW; |
params.width = rect.right - rect.left; |
@@ -811,7 +811,7 @@ |
params.set_parent = true; |
params.parent_window = parent; |
- channel_->Send(new AutomationMsg_TabReposition(0, tab_handle, params)); |
+ channel_->Send(new AutomationMsg_TabReposition(tab_handle, params)); |
::ShowWindow(parent, SW_SHOWNORMAL); |
} |
@@ -865,10 +865,10 @@ |
TimedMessageLoopRunner loop(MessageLoop::current()); |
ASSERT_THAT(mock_, testing::NotNull()); |
- EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _, _)) |
+ EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) |
.Times(testing::AnyNumber()); |
- EXPECT_CALL(*mock_, OnDidNavigate(testing::_, testing::_)) |
+ EXPECT_CALL(*mock_, OnDidNavigate(testing::_)) |
.Times(1) |
.WillOnce(testing::InvokeWithoutArgs(mock_, |
&ExternalTabUITestMockClient::DestroyHostWindow)); |
@@ -888,10 +888,10 @@ |
TimedMessageLoopRunner loop(MessageLoop::current()); |
ASSERT_THAT(mock_, testing::NotNull()); |
- EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _, _)) |
+ EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) |
.Times(testing::AnyNumber()); |
- EXPECT_CALL(*mock_, OnDidNavigate(testing::_, testing::_)) |
+ EXPECT_CALL(*mock_, OnDidNavigate(testing::_)) |
.Times(1) |
.WillOnce(testing::InvokeWithoutArgs(mock_, |
&ExternalTabUITestMockClient::DestroyHostWindow)); |
@@ -916,7 +916,7 @@ |
EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); |
- IPC::ExternalTabSettings incognito = |
+ ExternalTabSettings incognito = |
ExternalTabUITestMockClient::default_settings; |
incognito.is_off_the_record = true; |
// SetCookie is a sync call and deadlock can happen if window is visible, |
@@ -953,9 +953,9 @@ |
TimedMessageLoopRunner loop(MessageLoop::current()); |
ASSERT_THAT(mock_, testing::NotNull()); |
- EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _, _)) |
+ EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) |
.Times(testing::AnyNumber()); |
- EXPECT_CALL(*mock_, OnLoad(_, _)).Times(testing::AnyNumber()); |
+ EXPECT_CALL(*mock_, OnLoad(_)).Times(testing::AnyNumber()); |
std::string content = |
"data:text/html,<html><head><script>" |
@@ -969,7 +969,7 @@ |
"<body onload='onload()'>external tab test<br></div>" |
"</body></html>"; |
- EXPECT_CALL(*mock_, OnDidNavigate(testing::_, testing::_)) |
+ EXPECT_CALL(*mock_, OnDidNavigate(testing::_)) |
.Times(1) |
.WillOnce(testing::InvokeWithoutArgs(CreateFunctor( |
ReceivePointer(tab), |
@@ -977,7 +977,7 @@ |
std::string("Hello from gtest"), |
std::string("null"), std::string("*")))); |
- EXPECT_CALL(*mock_, OnForwardMessageToExternalHost(testing::_, |
+ EXPECT_CALL(*mock_, OnForwardMessageToExternalHost( |
testing::StrEq("Hello from gtest"), testing::_, testing::_)) |
.Times(1) |
.WillOnce(testing::DoAll( |
@@ -1001,21 +1001,21 @@ |
scoped_refptr<TabProxy> tab; |
TimedMessageLoopRunner loop(MessageLoop::current()); |
ASSERT_THAT(mock_, testing::NotNull()); |
- EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _, _)) |
+ EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) |
.Times(testing::AnyNumber()); |
- EXPECT_CALL(*mock_, OnLoad(_, _)).Times(testing::AnyNumber()); |
+ EXPECT_CALL(*mock_, OnLoad(_)).Times(testing::AnyNumber()); |
std::string kTestMessage("Hello from gtest"); |
std::string kTestOrigin("http://www.external.tab"); |
- EXPECT_CALL(*mock_, OnDidNavigate(1, testing::_)) |
+ EXPECT_CALL(*mock_, OnDidNavigate(testing::_)) |
.Times(1) |
.WillOnce(testing::InvokeWithoutArgs(CreateFunctor( |
ReceivePointer(tab), |
&TabProxy::HandleMessageFromExternalHost, |
kTestMessage, kTestOrigin, std::string("http://localhost:1337/")))); |
- EXPECT_CALL(*mock_, OnForwardMessageToExternalHost(1, |
+ EXPECT_CALL(*mock_, OnForwardMessageToExternalHost( |
testing::StrEq(kTestMessage), |
testing::_, |
testing::StrEq(GURL(kTestOrigin).GetOrigin().spec()))) |
@@ -1027,7 +1027,7 @@ |
EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); |
- IPC::ExternalTabSettings s = ExternalTabUITestMockClient::default_settings; |
+ ExternalTabSettings s = ExternalTabUITestMockClient::default_settings; |
s.load_requests_via_automation = false; |
s.initial_url = GURL("http://localhost:1337/files/post_message.html"); |
tab = mock_->CreateHostWindowAndTab(s); |
@@ -1039,20 +1039,20 @@ |
scoped_refptr<TabProxy> tab; |
TimedMessageLoopRunner loop(MessageLoop::current()); |
ASSERT_THAT(mock_, testing::NotNull()); |
- EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _, _)) |
+ EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) |
.Times(testing::AnyNumber()); |
- EXPECT_CALL(*mock_, OnLoad(_, _)).Times(testing::AnyNumber()); |
+ EXPECT_CALL(*mock_, OnLoad(_)).Times(testing::AnyNumber()); |
std::string url = "http://placetogo.org"; |
testing::InSequence sequence; |
- EXPECT_CALL(*mock_, OnRequestStart(1, 2, testing::AllOf( |
- testing::Field(&IPC::AutomationURLRequest::url, StrEq(url + "/")), |
- testing::Field(&IPC::AutomationURLRequest::method, StrEq("GET"))))) |
+ EXPECT_CALL(*mock_, OnRequestStart(2, testing::AllOf( |
+ testing::Field(&AutomationURLRequest::url, StrEq(url + "/")), |
+ testing::Field(&AutomationURLRequest::method, StrEq("GET"))))) |
.Times(1) |
// We can simply do CreateFunctor(1, 2, &http_200) since we know the |
// tab handle and request id, but using WithArgs<> is much more fancy :) |
- .WillOnce(testing::WithArgs<0, 1>(testing::Invoke(CreateFunctor(mock_, |
+ .WillOnce(testing::WithArgs<0, 0>(testing::Invoke(CreateFunctor(mock_, |
&ExternalTabUITestMockClient::ReplyStarted, |
&ExternalTabUITestMockClient::http_200)))); |
@@ -1060,34 +1060,34 @@ |
const std::string data = "<!DOCTYPE html><title>Hello</title>" |
"<img src=\"logo.gif\">"; |
- EXPECT_CALL(*mock_, OnRequestRead(1, 2, testing::Gt(0))) |
+ EXPECT_CALL(*mock_, OnRequestRead(2, testing::Gt(0))) |
.Times(2) |
.WillOnce(testing::InvokeWithoutArgs(CreateFunctor(mock_, |
&ExternalTabUITestMockClient::ReplyData, &data, 1, 2))) |
- .WillOnce(testing::WithArgs<0, 1>(testing::Invoke(CreateFunctor(mock_, |
+ .WillOnce(testing::WithArgs<0, 0>(testing::Invoke(CreateFunctor(mock_, |
&ExternalTabUITestMockClient::ReplyEOF)))); |
// Expect navigation is ok. |
- EXPECT_CALL(*mock_, OnDidNavigate(1, testing::Field(&IPC::NavigationInfo::url, |
- GURL(url)))) |
+ EXPECT_CALL(*mock_, OnDidNavigate(testing::Field(&NavigationInfo::url, |
+ GURL(url)))) |
.Times(1); |
// Expect GET request for logo.gif |
- EXPECT_CALL(*mock_, OnRequestStart(1, 3, testing::AllOf( |
- testing::Field(&IPC::AutomationURLRequest::url, StrEq(url + "/logo.gif")), |
- testing::Field(&IPC::AutomationURLRequest::method, StrEq("GET"))))) |
+ EXPECT_CALL(*mock_, OnRequestStart(3, testing::AllOf( |
+ testing::Field(&AutomationURLRequest::url, StrEq(url + "/logo.gif")), |
+ testing::Field(&AutomationURLRequest::method, StrEq("GET"))))) |
.Times(1) |
.WillOnce(testing::InvokeWithoutArgs(CreateFunctor(mock_, |
&ExternalTabUITestMockClient::Reply404, 1, 3))); |
- EXPECT_CALL(*mock_, OnRequestRead(1, 3, testing::Gt(0))) |
+ EXPECT_CALL(*mock_, OnRequestRead(3, testing::Gt(0))) |
.Times(1); |
// Chrome makes a brave request for favicon.ico |
- EXPECT_CALL(*mock_, OnRequestStart(1, 4, testing::AllOf( |
- testing::Field(&IPC::AutomationURLRequest::url, |
+ EXPECT_CALL(*mock_, OnRequestStart(4, testing::AllOf( |
+ testing::Field(&AutomationURLRequest::url, |
StrEq(url + "/favicon.ico")), |
- testing::Field(&IPC::AutomationURLRequest::method, StrEq("GET"))))) |
+ testing::Field(&AutomationURLRequest::method, StrEq("GET"))))) |
.Times(1) |
.WillOnce(testing::DoAll( |
testing::InvokeWithoutArgs(CreateFunctor(mock_, |
@@ -1097,7 +1097,7 @@ |
EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); |
- EXPECT_CALL(*mock_, OnRequestRead(1, 4, testing::Gt(0))) |
+ EXPECT_CALL(*mock_, OnRequestRead(4, testing::Gt(0))) |
.Times(1) |
.WillOnce(QUIT_LOOP_SOON(&loop, 300)); |
@@ -1110,36 +1110,36 @@ |
scoped_refptr<TabProxy> tab; |
TimedMessageLoopRunner loop(MessageLoop::current()); |
ASSERT_THAT(mock_, testing::NotNull()); |
- EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _, _)) |
+ EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) |
.Times(testing::AnyNumber()); |
std::string url = "http://placetogo.org"; |
testing::InSequence sequence; |
- EXPECT_CALL(*mock_, OnRequestStart(1, 2, testing::AllOf( |
- testing::Field(&IPC::AutomationURLRequest::url, StrEq(url + "/")), |
- testing::Field(&IPC::AutomationURLRequest::method, StrEq("GET"))))) |
+ EXPECT_CALL(*mock_, OnRequestStart(2, testing::AllOf( |
+ testing::Field(&AutomationURLRequest::url, StrEq(url + "/")), |
+ testing::Field(&AutomationURLRequest::method, StrEq("GET"))))) |
.Times(1) |
// We can simply do CreateFunctor(1, 2, &http_200) since we know the |
// tab handle and request id, but using WithArgs<> is much more fancy :) |
- .WillOnce(testing::WithArgs<0, 1>(testing::Invoke(CreateFunctor(mock_, |
+ .WillOnce(testing::WithArgs<0, 0>(testing::Invoke(CreateFunctor(mock_, |
&ExternalTabUITestMockClient::ReplyStarted, |
&ExternalTabUITestMockClient::http_200)))); |
// Return some trivial page, that have a link to a "logo.gif" image |
const std::string data = "<!DOCTYPE html><title>Hello"; |
- EXPECT_CALL(*mock_, OnRequestRead(1, 2, testing::Gt(0))) |
+ EXPECT_CALL(*mock_, OnRequestRead(2, testing::Gt(0))) |
.Times(2) |
.WillOnce(testing::InvokeWithoutArgs(CreateFunctor(mock_, |
&ExternalTabUITestMockClient::ReplyData, &data, 1, 2))) |
- .WillOnce(testing::WithArgs<0, 1>( |
+ .WillOnce(testing::WithArgs<0, 0>( |
testing::InvokeWithoutArgs(CreateFunctor(mock_, |
&ExternalTabUITestMockClient::DestroyHostWindow)))); |
EXPECT_CALL(*mock_, HandleClosed(1)).Times(1); |
- EXPECT_CALL(*mock_, OnRequestEnd(1, 2, testing::_)) |
+ EXPECT_CALL(*mock_, OnRequestEnd(2, testing::_)) |
.Times(1) |
.WillOnce(QUIT_LOOP_SOON(&loop, 300)); |
@@ -1152,24 +1152,24 @@ |
scoped_refptr<TabProxy> tab; |
TimedMessageLoopRunner loop(MessageLoop::current()); |
ASSERT_THAT(mock_, testing::NotNull()); |
- EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _, _)) |
+ EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) |
.Times(testing::AnyNumber()); |
- EXPECT_CALL(*mock_, OnLoad(_, _)).Times(testing::AnyNumber()); |
+ EXPECT_CALL(*mock_, OnLoad(_)).Times(testing::AnyNumber()); |
std::string url = "http://placetogo.org"; |
- EXPECT_CALL(*mock_, OnRequestStart(1, 3, testing::_)) |
+ EXPECT_CALL(*mock_, OnRequestStart(3, testing::_)) |
.Times(testing::AnyNumber()); |
- EXPECT_CALL(*mock_, OnDidNavigate(_, _)).Times(testing::AnyNumber()); |
+ EXPECT_CALL(*mock_, OnDidNavigate(_)).Times(testing::AnyNumber()); |
testing::InSequence sequence; |
- EXPECT_CALL(*mock_, OnRequestStart(1, 2, testing::AllOf( |
- testing::Field(&IPC::AutomationURLRequest::url, StrEq(url + "/")), |
- testing::Field(&IPC::AutomationURLRequest::method, StrEq("GET"))))) |
+ EXPECT_CALL(*mock_, OnRequestStart(2, testing::AllOf( |
+ testing::Field(&AutomationURLRequest::url, StrEq(url + "/")), |
+ testing::Field(&AutomationURLRequest::method, StrEq("GET"))))) |
.Times(1) |
// We can simply do CreateFunctor(1, 2, &http_200) since we know the |
// tab handle and request id, but using WithArgs<> is much more fancy :) |
- .WillOnce(testing::WithArgs<0, 1>(testing::Invoke(CreateFunctor(mock_, |
+ .WillOnce(testing::WithArgs<0, 0>(testing::Invoke(CreateFunctor(mock_, |
&ExternalTabUITestMockClient::ReplyStarted, |
&ExternalTabUITestMockClient::http_200)))); |
@@ -1192,17 +1192,17 @@ |
const std::string tail = "</body></html>"; |
- EXPECT_CALL(*mock_, OnRequestRead(1, 2, testing::Gt(0))) |
+ EXPECT_CALL(*mock_, OnRequestRead(2, testing::Gt(0))) |
.Times(1) |
.WillOnce(testing::InvokeWithoutArgs(CreateFunctor(mock_, |
&ExternalTabUITestMockClient::ReplyData, &head, 1, 2))); |
- EXPECT_CALL(*mock_, OnRequestRead(1, 2, testing::Gt(0))) |
+ EXPECT_CALL(*mock_, OnRequestRead(2, testing::Gt(0))) |
.Times(100) |
.WillRepeatedly(testing::InvokeWithoutArgs(CreateFunctor(mock_, |
&ExternalTabUITestMockClient::ReplyData, &data, 1, 2))); |
- EXPECT_CALL(*mock_, OnRequestRead(1, 2, testing::Gt(0))) |
+ EXPECT_CALL(*mock_, OnRequestRead(2, testing::Gt(0))) |
.Times(testing::AnyNumber()) |
.WillOnce(testing::DoAll( |
testing::InvokeWithoutArgs(CreateFunctor(mock_, |
@@ -1241,9 +1241,9 @@ |
ASSERT_THAT(mock_, testing::NotNull()); |
mock_->IgnoreFavIconNetworkRequest(); |
// Ignore navigation state changes. |
- EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _, _)) |
+ EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) |
.Times(testing::AnyNumber()); |
- EXPECT_CALL(*mock_, OnDidNavigate(_, _)).Times(testing::AnyNumber()); |
+ EXPECT_CALL(*mock_, OnDidNavigate(_)).Times(testing::AnyNumber()); |
GURL main_url("http://placetogo.com/"); |
std::string main_html = |
@@ -1252,7 +1252,7 @@ |
"height=320,width=300,left=1');" |
"</script></head><body>Main.</body></html>"; |
mock_->ServeHTMLData(1, main_url, main_html); |
- EXPECT_CALL(*mock_, OnLoad(1, _)).Times(1); |
+ EXPECT_CALL(*mock_, OnLoad(_)).Times(1); |
GURL popup1_url("http://placetogo.com/popup1.html"); |
std::string popup1_html = |
@@ -1260,12 +1260,12 @@ |
"window.open('popup2.html','','');" |
"</script></head><body>Popup1.</body></html>"; |
mock_->ServeHTMLData(2, popup1_url, popup1_html); |
- EXPECT_CALL(*mock_, OnLoad(2, _)).Times(1); |
+ EXPECT_CALL(*mock_, OnLoad(_)).Times(1); |
GURL popup2_url("http://placetogo.com/popup2.html"); |
std::string popup2_html = "<html><body>Popup2.</body></html>"; |
mock_->ServeHTMLData(3, popup2_url, popup2_html); |
- EXPECT_CALL(*mock_, OnLoad(3, _)).Times(1) |
+ EXPECT_CALL(*mock_, OnLoad(_)).Times(1) |
.WillOnce(QUIT_LOOP_SOON(&loop, 500)); |
DWORD style = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN; |
@@ -1277,14 +1277,14 @@ |
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, |
NULL, NULL, NULL, NULL); |
- EXPECT_CALL(*mock_, OnAttachExternalTab(1, _)) |
+ EXPECT_CALL(*mock_, OnAttachExternalTab(_)) |
.Times(1) |
- .WillOnce(testing::WithArgs<1>(testing::Invoke(CreateFunctor(mock_, |
+ .WillOnce(testing::WithArgs<0>(testing::Invoke(CreateFunctor(mock_, |
&ExternalTabUITestMockClient::ConnectToExternalTab, popup1_host)))); |
- EXPECT_CALL(*mock_, OnAttachExternalTab(2, _)) |
+ EXPECT_CALL(*mock_, OnAttachExternalTab(_)) |
.Times(1) |
- .WillOnce(testing::WithArgs<1>(testing::Invoke(CreateFunctor(mock_, |
+ .WillOnce(testing::WithArgs<0>(testing::Invoke(CreateFunctor(mock_, |
&ExternalTabUITestMockClient::ConnectToExternalTab, popup2_host)))); |
mock_->CreateTabWithUrl(main_url); |
@@ -1306,9 +1306,9 @@ |
ASSERT_THAT(mock_, testing::NotNull()); |
mock_->IgnoreFavIconNetworkRequest(); |
// Ignore navigation state changes. |
- EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _, _)) |
+ EXPECT_CALL(*mock_, OnNavigationStateChanged(_, _)) |
.Times(testing::AnyNumber()); |
- EXPECT_CALL(*mock_, OnDidNavigate(_, _)).Times(testing::AnyNumber()); |
+ EXPECT_CALL(*mock_, OnDidNavigate(_)).Times(testing::AnyNumber()); |
GURL main_url("http://placetogo.com/"); |
std::string main_html = "<!DOCTYPE html><title>Hello</title>" |
@@ -1320,11 +1320,11 @@ |
CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL); |
testing::InSequence s; |
- EXPECT_CALL(*mock_, OnLoad(1, _)) |
+ EXPECT_CALL(*mock_, OnLoad(_)) |
.WillOnce(testing::InvokeWithoutArgs(testing::CreateFunctor(mock_, |
&ExternalTabUITestMockClient::NavigateThroughUserGesture))); |
- EXPECT_CALL(*mock_, OnAttachExternalTab(1, _)) |
+ EXPECT_CALL(*mock_, OnAttachExternalTab(_)) |
.Times(1) |
.WillOnce(QUIT_LOOP_SOON(&loop, 500)); |