| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/commands/webelement_commands.h" | 5 #include "chrome/test/webdriver/commands/webelement_commands.h" |
| 6 | 6 |
| 7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/third_party/icu/icu_utf.h" | 9 #include "base/third_party/icu/icu_utf.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 if (path_segments_.size() < 7) { | 212 if (path_segments_.size() < 7) { |
| 213 SET_WEBDRIVER_ERROR(response, "Path segments is less than 7", | 213 SET_WEBDRIVER_ERROR(response, "Path segments is less than 7", |
| 214 kBadRequest); | 214 kBadRequest); |
| 215 return; | 215 return; |
| 216 } | 216 } |
| 217 | 217 |
| 218 std::string script = "return arguments[0] == arguments[1];"; | 218 std::string script = "return arguments[0] == arguments[1];"; |
| 219 | 219 |
| 220 scoped_ptr<ListValue> args(new ListValue); | 220 scoped_ptr<ListValue> args(new ListValue); |
| 221 args->Append(element.ToValue()); | 221 args->Append(element.ToValue()); |
| 222 args->Append(Value::CreateStringValue(path_segments_.at(6))); | 222 |
| 223 WebElementId other_element(path_segments_.at(6)); |
| 224 args->Append(other_element.ToValue()); |
| 223 | 225 |
| 224 Value* result = NULL; | 226 Value* result = NULL; |
| 225 ErrorCode status = session_->ExecuteScript(script, args.get(), &result); | 227 ErrorCode status = session_->ExecuteScript(script, args.get(), &result); |
| 226 response->SetStatus(status); | 228 response->SetStatus(status); |
| 227 response->SetValue(result); | 229 response->SetValue(result); |
| 228 } | 230 } |
| 229 | 231 |
| 230 ///////////////////// ElementLocationCommand //////////////////// | 232 ///////////////////// ElementLocationCommand //////////////////// |
| 231 | 233 |
| 232 ElementLocationCommand::ElementLocationCommand( | 234 ElementLocationCommand::ElementLocationCommand( |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 SET_WEBDRIVER_ERROR(response, | 536 SET_WEBDRIVER_ERROR(response, |
| 535 "Result is not string type", | 537 "Result is not string type", |
| 536 kInternalServerError); | 538 kInternalServerError); |
| 537 return; | 539 return; |
| 538 } | 540 } |
| 539 response->SetStatus(kSuccess); | 541 response->SetStatus(kSuccess); |
| 540 response->SetValue(result.release()); | 542 response->SetValue(result.release()); |
| 541 } | 543 } |
| 542 | 544 |
| 543 } // namespace webdriver | 545 } // namespace webdriver |
| OLD | NEW |