OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/test/chromedriver/command_executor_impl.h" | 5 #include "chrome/test/chromedriver/command_executor_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 WindowCommandMap window_command_map; | 95 WindowCommandMap window_command_map; |
96 // Wrap ElementCommand into WindowCommand. | 96 // Wrap ElementCommand into WindowCommand. |
97 for (ElementCommandMap::const_iterator it = element_command_map.begin(); | 97 for (ElementCommandMap::const_iterator it = element_command_map.begin(); |
98 it != element_command_map.end(); ++it) { | 98 it != element_command_map.end(); ++it) { |
99 window_command_map[it->first] = | 99 window_command_map[it->first] = |
100 base::Bind(&ExecuteElementCommand, it->second); | 100 base::Bind(&ExecuteElementCommand, it->second); |
101 } | 101 } |
102 window_command_map[CommandNames::kGet] = base::Bind(&ExecuteGet); | 102 window_command_map[CommandNames::kGet] = base::Bind(&ExecuteGet); |
103 window_command_map[CommandNames::kExecuteScript] = | 103 window_command_map[CommandNames::kExecuteScript] = |
104 base::Bind(&ExecuteExecuteScript); | 104 base::Bind(&ExecuteExecuteScript); |
| 105 window_command_map[CommandNames::kExecuteAsyncScript] = |
| 106 base::Bind(&ExecuteExecuteAsyncScript); |
105 window_command_map[CommandNames::kSwitchToFrame] = | 107 window_command_map[CommandNames::kSwitchToFrame] = |
106 base::Bind(&ExecuteSwitchToFrame); | 108 base::Bind(&ExecuteSwitchToFrame); |
107 window_command_map[CommandNames::kGetTitle] = | 109 window_command_map[CommandNames::kGetTitle] = |
108 base::Bind(&ExecuteGetTitle); | 110 base::Bind(&ExecuteGetTitle); |
109 window_command_map[CommandNames::kGetPageSource] = | 111 window_command_map[CommandNames::kGetPageSource] = |
110 base::Bind(&ExecuteGetPageSource); | 112 base::Bind(&ExecuteGetPageSource); |
111 window_command_map[CommandNames::kFindElement] = | 113 window_command_map[CommandNames::kFindElement] = |
112 base::Bind(&ExecuteFindElement, 50); | 114 base::Bind(&ExecuteFindElement, 50); |
113 window_command_map[CommandNames::kFindElements] = | 115 window_command_map[CommandNames::kFindElements] = |
114 base::Bind(&ExecuteFindElements, 50); | 116 base::Bind(&ExecuteFindElements, 50); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 session_command_map[CommandNames::kGetCurrentWindowHandle] = | 187 session_command_map[CommandNames::kGetCurrentWindowHandle] = |
186 base::Bind(&ExecuteGetCurrentWindowHandle); | 188 base::Bind(&ExecuteGetCurrentWindowHandle); |
187 session_command_map[CommandNames::kClose] = | 189 session_command_map[CommandNames::kClose] = |
188 base::Bind(&ExecuteClose); | 190 base::Bind(&ExecuteClose); |
189 session_command_map[CommandNames::kGetWindowHandles] = | 191 session_command_map[CommandNames::kGetWindowHandles] = |
190 base::Bind(&ExecuteGetWindowHandles); | 192 base::Bind(&ExecuteGetWindowHandles); |
191 session_command_map[CommandNames::kSwitchToWindow] = | 193 session_command_map[CommandNames::kSwitchToWindow] = |
192 base::Bind(&ExecuteSwitchToWindow); | 194 base::Bind(&ExecuteSwitchToWindow); |
193 session_command_map[CommandNames::kSetTimeout] = | 195 session_command_map[CommandNames::kSetTimeout] = |
194 base::Bind(&ExecuteSetTimeout); | 196 base::Bind(&ExecuteSetTimeout); |
| 197 session_command_map[CommandNames::kSetScriptTimeout] = |
| 198 base::Bind(&ExecuteSetScriptTimeout); |
195 session_command_map[CommandNames::kGetAlert] = | 199 session_command_map[CommandNames::kGetAlert] = |
196 base::Bind(&ExecuteGetAlert); | 200 base::Bind(&ExecuteGetAlert); |
197 session_command_map[CommandNames::kGetAlertText] = | 201 session_command_map[CommandNames::kGetAlertText] = |
198 base::Bind(&ExecuteGetAlertText); | 202 base::Bind(&ExecuteGetAlertText); |
199 session_command_map[CommandNames::kSetAlertValue] = | 203 session_command_map[CommandNames::kSetAlertValue] = |
200 base::Bind(&ExecuteSetAlertValue); | 204 base::Bind(&ExecuteSetAlertValue); |
201 session_command_map[CommandNames::kAcceptAlert] = | 205 session_command_map[CommandNames::kAcceptAlert] = |
202 base::Bind(&ExecuteAcceptAlert); | 206 base::Bind(&ExecuteAcceptAlert); |
203 session_command_map[CommandNames::kDismissAlert] = | 207 session_command_map[CommandNames::kDismissAlert] = |
204 base::Bind(&ExecuteDismissAlert); | 208 base::Bind(&ExecuteDismissAlert); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 base::SysInfo::OperatingSystemName().c_str(), | 260 base::SysInfo::OperatingSystemName().c_str(), |
257 base::SysInfo::OperatingSystemVersion().c_str(), | 261 base::SysInfo::OperatingSystemVersion().c_str(), |
258 base::SysInfo::OperatingSystemArchitecture().c_str())); | 262 base::SysInfo::OperatingSystemArchitecture().c_str())); |
259 scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue()); | 263 scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue()); |
260 error->SetString("message", status.message()); | 264 error->SetString("message", status.message()); |
261 value->reset(error.release()); | 265 value->reset(error.release()); |
262 } | 266 } |
263 if (!*value) | 267 if (!*value) |
264 value->reset(base::Value::CreateNullValue()); | 268 value->reset(base::Value::CreateNullValue()); |
265 } | 269 } |
OLD | NEW |