summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation/browser_proxy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/automation/browser_proxy.cc')
-rw-r--r--chrome/test/automation/browser_proxy.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc
index 425c6b5..8a30c31 100644
--- a/chrome/test/automation/browser_proxy.cc
+++ b/chrome/test/automation/browser_proxy.cc
@@ -372,3 +372,23 @@ bool BrowserProxy::GetBookmarkBarVisibility(bool* is_visible,
delete response;
return true;
}
+
+bool BrowserProxy::SetIntPreference(const std::wstring& name, int value) {
+ if (!is_valid())
+ return false;
+
+ IPC::Message* response = NULL;
+ bool success = sender_->SendAndWaitForResponse(
+ new AutomationMsg_SetIntPreferenceRequest(0, handle_, name , value),
+ &response, AutomationMsg_SetIntPreferenceResponse::ID);
+
+ scoped_ptr<IPC::Message> response_deleter(response); // Delete on return.
+ if (!success)
+ return false;
+
+ if (AutomationMsg_SetIntPreferenceResponse::Read(response, &success))
+ return success;
+
+ // We failed to deserialize the returned value.
+ return false;
+} \ No newline at end of file