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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 const std::string& element_id, | 330 const std::string& element_id, |
331 const std::string& attribute_name, | 331 const std::string& attribute_name, |
332 const std::string& attribute_value, | 332 const std::string& attribute_value, |
333 bool* is_equal) { | 333 bool* is_equal) { |
334 scoped_ptr<base::Value> result; | 334 scoped_ptr<base::Value> result; |
335 Status status = GetElementAttribute( | 335 Status status = GetElementAttribute( |
336 session, web_view, element_id, attribute_name, &result); | 336 session, web_view, element_id, attribute_name, &result); |
337 if (status.IsError()) | 337 if (status.IsError()) |
338 return status; | 338 return status; |
339 std::string actual_value; | 339 std::string actual_value; |
340 if (result->GetAsString(&actual_value)) | 340 if (result->GetAsString(&actual_value)) { |
341 *is_equal = LowerCaseEqualsASCII(actual_value, attribute_value.c_str()); | 341 *is_equal = |
342 else | 342 base::LowerCaseEqualsASCII(actual_value, attribute_value.c_str()); |
| 343 } else { |
343 *is_equal = false; | 344 *is_equal = false; |
| 345 } |
344 return status; | 346 return status; |
345 } | 347 } |
346 | 348 |
347 Status GetElementClickableLocation( | 349 Status GetElementClickableLocation( |
348 Session* session, | 350 Session* session, |
349 WebView* web_view, | 351 WebView* web_view, |
350 const std::string& element_id, | 352 const std::string& element_id, |
351 WebPoint* location) { | 353 WebPoint* location) { |
352 std::string tag_name; | 354 std::string tag_name; |
353 Status status = GetElementTagName(session, web_view, element_id, &tag_name); | 355 Status status = GetElementTagName(session, web_view, element_id, &tag_name); |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 status = ScrollElementRegionIntoViewHelper( | 647 status = ScrollElementRegionIntoViewHelper( |
646 rit->parent_frame_id, web_view, frame_element_id, | 648 rit->parent_frame_id, web_view, frame_element_id, |
647 WebRect(region_offset, region_size), | 649 WebRect(region_offset, region_size), |
648 center, frame_element_id, ®ion_offset); | 650 center, frame_element_id, ®ion_offset); |
649 if (status.IsError()) | 651 if (status.IsError()) |
650 return status; | 652 return status; |
651 } | 653 } |
652 *location = region_offset; | 654 *location = region_offset; |
653 return Status(kOk); | 655 return Status(kOk); |
654 } | 656 } |
OLD | NEW |