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 "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/threading/platform_thread.h" | 10 #include "base/threading/platform_thread.h" |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 const std::string& element_id, | 331 const std::string& element_id, |
332 const std::string& attribute_name, | 332 const std::string& attribute_name, |
333 const std::string& attribute_value, | 333 const std::string& attribute_value, |
334 bool* is_equal) { | 334 bool* is_equal) { |
335 scoped_ptr<base::Value> result; | 335 scoped_ptr<base::Value> result; |
336 Status status = GetElementAttribute( | 336 Status status = GetElementAttribute( |
337 session, web_view, element_id, attribute_name, &result); | 337 session, web_view, element_id, attribute_name, &result); |
338 if (status.IsError()) | 338 if (status.IsError()) |
339 return status; | 339 return status; |
340 std::string actual_value; | 340 std::string actual_value; |
341 if (result->GetAsString(&actual_value)) | 341 if (result->GetAsString(&actual_value)) { |
342 *is_equal = LowerCaseEqualsASCII(actual_value, attribute_value.c_str()); | 342 *is_equal = |
343 else | 343 base::LowerCaseEqualsASCII(actual_value, attribute_value.c_str()); |
| 344 } else { |
344 *is_equal = false; | 345 *is_equal = false; |
| 346 } |
345 return status; | 347 return status; |
346 } | 348 } |
347 | 349 |
348 Status GetElementClickableLocation( | 350 Status GetElementClickableLocation( |
349 Session* session, | 351 Session* session, |
350 WebView* web_view, | 352 WebView* web_view, |
351 const std::string& element_id, | 353 const std::string& element_id, |
352 WebPoint* location) { | 354 WebPoint* location) { |
353 std::string tag_name; | 355 std::string tag_name; |
354 Status status = GetElementTagName(session, web_view, element_id, &tag_name); | 356 Status status = GetElementTagName(session, web_view, element_id, &tag_name); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 status = ScrollElementRegionIntoViewHelper( | 652 status = ScrollElementRegionIntoViewHelper( |
651 rit->parent_frame_id, web_view, frame_element_id, | 653 rit->parent_frame_id, web_view, frame_element_id, |
652 WebRect(region_offset, region_size), | 654 WebRect(region_offset, region_size), |
653 center, frame_element_id, ®ion_offset); | 655 center, frame_element_id, ®ion_offset); |
654 if (status.IsError()) | 656 if (status.IsError()) |
655 return status; | 657 return status; |
656 } | 658 } |
657 *location = region_offset; | 659 *location = region_offset; |
658 return Status(kOk); | 660 return Status(kOk); |
659 } | 661 } |
OLD | NEW |