From 71f65dd427f9a579d258162fd02a73ae9a500916 Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Wed, 11 Feb 2009 19:14:56 +0000 Subject: 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 --- chrome/test/automation/autocomplete_edit_proxy.cc | 61 +++++++---------------- 1 file changed, 17 insertions(+), 44 deletions(-) (limited to 'chrome/test/automation/autocomplete_edit_proxy.cc') 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 response_deleter(response); + bool result = false; - Tuple2 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 response_deleter(response); + bool edit_exists = false; - Tuple2 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 response_deleter(response); + bool edit_exists = false; - Tuple2 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; } - -- cgit v1.1