| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webdriver/session.h" | 5 #include "chrome/test/webdriver/session.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1183 if (error_msg.empty()) | 1183 if (error_msg.empty()) |
| 1184 error_msg = "Script failed with error code: " + base::IntToString(code); | 1184 error_msg = "Script failed with error code: " + base::IntToString(code); |
| 1185 return new Error(code, error_msg); | 1185 return new Error(code, error_msg); |
| 1186 } | 1186 } |
| 1187 | 1187 |
| 1188 Value* tmp; | 1188 Value* tmp; |
| 1189 if (result_dict->Get("value", &tmp)) { | 1189 if (result_dict->Get("value", &tmp)) { |
| 1190 *script_result= tmp->DeepCopy(); | 1190 *script_result= tmp->DeepCopy(); |
| 1191 } else { | 1191 } else { |
| 1192 // "value" was not defined in the returned dictionary; set to null. | 1192 // "value" was not defined in the returned dictionary; set to null. |
| 1193 *script_result= Value::CreateNullValue(); | 1193 *script_result= base::NullValue(); |
| 1194 } | 1194 } |
| 1195 return NULL; | 1195 return NULL; |
| 1196 } | 1196 } |
| 1197 | 1197 |
| 1198 void Session::SendKeysOnSessionThread(const string16& keys, Error** error) { | 1198 void Session::SendKeysOnSessionThread(const string16& keys, Error** error) { |
| 1199 std::vector<WebKeyEvent> key_events; | 1199 std::vector<WebKeyEvent> key_events; |
| 1200 std::string error_msg; | 1200 std::string error_msg; |
| 1201 if (!ConvertKeysToWebKeyEvents(keys, &key_events, &error_msg)) { | 1201 if (!ConvertKeysToWebKeyEvents(keys, &key_events, &error_msg)) { |
| 1202 *error = new Error(kUnknownError, error_msg); | 1202 *error = new Error(kUnknownError, error_msg); |
| 1203 return; | 1203 return; |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1516 if (error) | 1516 if (error) |
| 1517 return error; | 1517 return error; |
| 1518 if (!value->GetAsInteger(status)) | 1518 if (!value->GetAsInteger(status)) |
| 1519 return new Error(kUnknownError, | 1519 return new Error(kUnknownError, |
| 1520 "GET_APPCACHE_STATUS script returned non-integer: " + | 1520 "GET_APPCACHE_STATUS script returned non-integer: " + |
| 1521 JsonStringify(value.get())); | 1521 JsonStringify(value.get())); |
| 1522 return NULL; | 1522 return NULL; |
| 1523 } | 1523 } |
| 1524 | 1524 |
| 1525 } // namespace webdriver | 1525 } // namespace webdriver |
| OLD | NEW |