summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation/autocomplete_edit_proxy.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-11 19:14:56 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-11 19:14:56 +0000
commit71f65dd427f9a579d258162fd02a73ae9a500916 (patch)
tree43630d5ca64029a0f82db8831c08a0e032991e31 /chrome/test/automation/autocomplete_edit_proxy.cc
parent521c0356810dac743b751c0f96bf605e6b41e880 (diff)
downloadchromium_src-71f65dd427f9a579d258162fd02a73ae9a500916.zip
chromium_src-71f65dd427f9a579d258162fd02a73ae9a500916.tar.gz
chromium_src-71f65dd427f9a579d258162fd02a73ae9a500916.tar.bz2
The Chrome Automation framework is based on a homegrown request response IPC model and thus ends up duplicating a lot of functionality already available in the SyncChannel.
This CL gets the automation framework to use the SyncChannel. The request response IPCs have been changed to sync IPCs. Review URL: http://codereview.chromium.org/20189 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9585 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation/autocomplete_edit_proxy.cc')
-rw-r--r--chrome/test/automation/autocomplete_edit_proxy.cc61
1 files changed, 17 insertions, 44 deletions
diff --git a/chrome/test/automation/autocomplete_edit_proxy.cc b/chrome/test/automation/autocomplete_edit_proxy.cc
index 3758c74..f7f23f2e 100644
--- a/chrome/test/automation/autocomplete_edit_proxy.cc
+++ b/chrome/test/automation/autocomplete_edit_proxy.cc
@@ -21,34 +21,23 @@ bool AutocompleteEditProxy::GetText(std::wstring* text) const {
return false;
}
- IPC::Message* response = NULL;
- if (!sender_->SendAndWaitForResponse(
- new AutomationMsg_AutocompleteEditGetTextRequest(0, handle_), &response,
- AutomationMsg_AutocompleteEditGetTextResponse::ID))
- return false;
- scoped_ptr<IPC::Message> response_deleter(response);
+ bool result = false;
- Tuple2<bool, std::wstring> returned_result;
- if (!AutomationMsg_AutocompleteEditGetTextResponse::Read(response,
- &returned_result) || !returned_result.a)
- return false;
+ sender_->Send(new AutomationMsg_AutocompleteEditGetText(0, handle_, &result,
+ text));
- text->swap(returned_result.b);
- return true;
+ return result;
}
bool AutocompleteEditProxy::SetText(const std::wstring& text) {
if (!is_valid())
return false;
- IPC::Message* response = NULL;
- if (!sender_->SendAndWaitForResponse(
- new AutomationMsg_AutocompleteEditSetTextRequest(0, handle_, text),
- &response, AutomationMsg_AutocompleteEditSetTextResponse::ID))
- return false;
+ bool result = false;
- delete response;
- return true;
+ sender_->Send(new AutomationMsg_AutocompleteEditSetText(0, handle_, text,
+ &result));
+ return result;
}
bool AutocompleteEditProxy::IsQueryInProgress(bool* query_in_progress) const {
@@ -59,20 +48,13 @@ bool AutocompleteEditProxy::IsQueryInProgress(bool* query_in_progress) const {
return false;
}
- IPC::Message* response = NULL;
- if (!sender_->SendAndWaitForResponse(
- new AutomationMsg_AutocompleteEditIsQueryInProgressRequest(0, handle_),
- &response, AutomationMsg_AutocompleteEditIsQueryInProgressResponse::ID))
- return false;
- scoped_ptr<IPC::Message> response_deleter(response);
+ bool edit_exists = false;
- Tuple2<bool, bool> returned_result;
- if (!AutomationMsg_AutocompleteEditIsQueryInProgressResponse::Read(
- response, &returned_result) || !returned_result.a)
- return false;
+ sender_->Send(
+ new AutomationMsg_AutocompleteEditIsQueryInProgress(
+ 0, handle_, &edit_exists, query_in_progress));
- *query_in_progress = returned_result.b;
- return true;
+ return edit_exists;
}
@@ -97,19 +79,10 @@ bool AutocompleteEditProxy::GetAutocompleteMatches(Matches* matches) const {
return false;
}
- IPC::Message* response = NULL;
- if (!sender_->SendAndWaitForResponse(
- new AutomationMsg_AutocompleteEditGetMatchesRequest(0, handle_),
- &response, AutomationMsg_AutocompleteEditGetMatchesResponse::ID))
- return false;
- scoped_ptr<IPC::Message> response_deleter(response);
+ bool edit_exists = false;
- Tuple2<bool, Matches> returned_result;
- if (!AutomationMsg_AutocompleteEditGetMatchesResponse::Read(
- response, &returned_result) || !returned_result.a)
- return false;
+ sender_->Send(new AutomationMsg_AutocompleteEditGetMatches(
+ 0, handle_, &edit_exists, matches));
- *matches = returned_result.b;
- return true;
+ return edit_exists;
}
-