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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 it != window_command_map.end(); ++it) { | 101 it != window_command_map.end(); ++it) { |
102 session_command_map[it->first] = | 102 session_command_map[it->first] = |
103 base::Bind(&ExecuteWindowCommand, it->second); | 103 base::Bind(&ExecuteWindowCommand, it->second); |
104 } | 104 } |
105 session_command_map[CommandNames::kQuit] = | 105 session_command_map[CommandNames::kQuit] = |
106 base::Bind(&ExecuteQuit, &session_map_); | 106 base::Bind(&ExecuteQuit, &session_map_); |
107 session_command_map[CommandNames::kGetCurrentWindowHandle] = | 107 session_command_map[CommandNames::kGetCurrentWindowHandle] = |
108 base::Bind(&ExecuteGetCurrentWindowHandle); | 108 base::Bind(&ExecuteGetCurrentWindowHandle); |
109 session_command_map[CommandNames::kGetWindowHandles] = | 109 session_command_map[CommandNames::kGetWindowHandles] = |
110 base::Bind(&ExecuteGetWindowHandles); | 110 base::Bind(&ExecuteGetWindowHandles); |
| 111 session_command_map[CommandNames::kSwitchToWindow] = |
| 112 base::Bind(&ExecuteSwitchToWindow); |
111 session_command_map[CommandNames::kSetTimeout] = | 113 session_command_map[CommandNames::kSetTimeout] = |
112 base::Bind(&ExecuteSetTimeout); | 114 base::Bind(&ExecuteSetTimeout); |
113 | 115 |
114 // Wrap SessionCommand into non-session Command. | 116 // Wrap SessionCommand into non-session Command. |
115 base::Callback<Status( | 117 base::Callback<Status( |
116 const SessionCommand&, | 118 const SessionCommand&, |
117 const base::DictionaryValue&, | 119 const base::DictionaryValue&, |
118 const std::string&, | 120 const std::string&, |
119 scoped_ptr<base::Value>*, | 121 scoped_ptr<base::Value>*, |
120 std::string*)> execute_session_command = base::Bind( | 122 std::string*)> execute_session_command = base::Bind( |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 } | 160 } |
159 *status_code = status.code(); | 161 *status_code = status.code(); |
160 if (status.IsError()) { | 162 if (status.IsError()) { |
161 scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue()); | 163 scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue()); |
162 error->SetString("message", status.message()); | 164 error->SetString("message", status.message()); |
163 value->reset(error.release()); | 165 value->reset(error.release()); |
164 } | 166 } |
165 if (!*value) | 167 if (!*value) |
166 value->reset(base::Value::CreateNullValue()); | 168 value->reset(base::Value::CreateNullValue()); |
167 } | 169 } |
OLD | NEW |