| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/element_commands.h" | 5 #include "chrome/test/chromedriver/element_commands.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 WebView* web_view, | 466 WebView* web_view, |
| 467 const std::string& element_id, | 467 const std::string& element_id, |
| 468 const base::DictionaryValue& params, | 468 const base::DictionaryValue& params, |
| 469 std::unique_ptr<base::Value>* value) { | 469 std::unique_ptr<base::Value>* value) { |
| 470 WebPoint offset(0, 0); | 470 WebPoint offset(0, 0); |
| 471 WebPoint location; | 471 WebPoint location; |
| 472 Status status = ScrollElementIntoView( | 472 Status status = ScrollElementIntoView( |
| 473 session, web_view, element_id, &offset, &location); | 473 session, web_view, element_id, &offset, &location); |
| 474 if (status.IsError()) | 474 if (status.IsError()) |
| 475 return status; | 475 return status; |
| 476 value->reset(CreateValueFrom(location)); | 476 *value = CreateValueFrom(location); |
| 477 return Status(kOk); | 477 return Status(kOk); |
| 478 } | 478 } |
| 479 | 479 |
| 480 Status ExecuteGetElementSize(Session* session, | 480 Status ExecuteGetElementSize(Session* session, |
| 481 WebView* web_view, | 481 WebView* web_view, |
| 482 const std::string& element_id, | 482 const std::string& element_id, |
| 483 const base::DictionaryValue& params, | 483 const base::DictionaryValue& params, |
| 484 std::unique_ptr<base::Value>* value) { | 484 std::unique_ptr<base::Value>* value) { |
| 485 base::ListValue args; | 485 base::ListValue args; |
| 486 args.Append(CreateElement(element_id)); | 486 args.Append(CreateElement(element_id)); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 WebView* web_view, | 524 WebView* web_view, |
| 525 const std::string& element_id, | 525 const std::string& element_id, |
| 526 const base::DictionaryValue& params, | 526 const base::DictionaryValue& params, |
| 527 std::unique_ptr<base::Value>* value) { | 527 std::unique_ptr<base::Value>* value) { |
| 528 std::string other_element_id; | 528 std::string other_element_id; |
| 529 if (!params.GetString("other", &other_element_id)) | 529 if (!params.GetString("other", &other_element_id)) |
| 530 return Status(kUnknownError, "'other' must be a string"); | 530 return Status(kUnknownError, "'other' must be a string"); |
| 531 value->reset(new base::FundamentalValue(element_id == other_element_id)); | 531 value->reset(new base::FundamentalValue(element_id == other_element_id)); |
| 532 return Status(kOk); | 532 return Status(kOk); |
| 533 } | 533 } |
| OLD | NEW |