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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 base::SysInfo::OperatingSystemName().c_str(), | 258 base::SysInfo::OperatingSystemName().c_str(), |
257 base::SysInfo::OperatingSystemVersion().c_str(), | 259 base::SysInfo::OperatingSystemVersion().c_str(), |
258 base::SysInfo::OperatingSystemArchitecture().c_str())); | 260 base::SysInfo::OperatingSystemArchitecture().c_str())); |
259 scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue()); | 261 scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue()); |
260 error->SetString("message", status.message()); | 262 error->SetString("message", status.message()); |
261 value->reset(error.release()); | 263 value->reset(error.release()); |
262 } | 264 } |
263 if (!*value) | 265 if (!*value) |
264 value->reset(base::Value::CreateNullValue()); | 266 value->reset(base::Value::CreateNullValue()); |
265 } | 267 } |
OLD | NEW |