| 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_util.h" | 5 #include "chrome/test/chromedriver/element_util.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 const std::string& attribute_name, | 339 const std::string& attribute_name, |
| 340 const std::string& attribute_value, | 340 const std::string& attribute_value, |
| 341 bool* is_equal) { | 341 bool* is_equal) { |
| 342 std::unique_ptr<base::Value> result; | 342 std::unique_ptr<base::Value> result; |
| 343 Status status = GetElementAttribute( | 343 Status status = GetElementAttribute( |
| 344 session, web_view, element_id, attribute_name, &result); | 344 session, web_view, element_id, attribute_name, &result); |
| 345 if (status.IsError()) | 345 if (status.IsError()) |
| 346 return status; | 346 return status; |
| 347 std::string actual_value; | 347 std::string actual_value; |
| 348 if (result->GetAsString(&actual_value)) { | 348 if (result->GetAsString(&actual_value)) { |
| 349 *is_equal = | 349 *is_equal = base::LowerCaseEqualsASCII(actual_value, attribute_value); |
| 350 base::LowerCaseEqualsASCII(actual_value, attribute_value.c_str()); | |
| 351 } else { | 350 } else { |
| 352 *is_equal = false; | 351 *is_equal = false; |
| 353 } | 352 } |
| 354 return status; | 353 return status; |
| 355 } | 354 } |
| 356 | 355 |
| 357 Status GetElementClickableLocation( | 356 Status GetElementClickableLocation( |
| 358 Session* session, | 357 Session* session, |
| 359 WebView* web_view, | 358 WebView* web_view, |
| 360 const std::string& element_id, | 359 const std::string& element_id, |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 status = ScrollElementRegionIntoViewHelper( | 654 status = ScrollElementRegionIntoViewHelper( |
| 656 rit->parent_frame_id, web_view, frame_element_id, | 655 rit->parent_frame_id, web_view, frame_element_id, |
| 657 WebRect(region_offset, region_size), | 656 WebRect(region_offset, region_size), |
| 658 center, frame_element_id, ®ion_offset); | 657 center, frame_element_id, ®ion_offset); |
| 659 if (status.IsError()) | 658 if (status.IsError()) |
| 660 return status; | 659 return status; |
| 661 } | 660 } |
| 662 *location = region_offset; | 661 *location = region_offset; |
| 663 return Status(kOk); | 662 return Status(kOk); |
| 664 } | 663 } |
| OLD | NEW |