Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: chrome/test/chromedriver/element_commands.cc

Issue 817913004: [chromedriver] Make GetElementLocationInView return the top-left coordinate rather than the center (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment to ScrollElementIntoView() Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/chromedriver/element_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <cmath> 7 #include <cmath>
8 #include <list> 8 #include <list>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 args, 436 args,
437 value); 437 value);
438 } 438 }
439 439
440 Status ExecuteGetElementLocationOnceScrolledIntoView( 440 Status ExecuteGetElementLocationOnceScrolledIntoView(
441 Session* session, 441 Session* session,
442 WebView* web_view, 442 WebView* web_view,
443 const std::string& element_id, 443 const std::string& element_id,
444 const base::DictionaryValue& params, 444 const base::DictionaryValue& params,
445 scoped_ptr<base::Value>* value) { 445 scoped_ptr<base::Value>* value) {
446 WebPoint offset(0, 0);
446 WebPoint location; 447 WebPoint location;
447 Status status = ScrollElementIntoView( 448 Status status = ScrollElementIntoView(
448 session, web_view, element_id, nullptr, &location); 449 session, web_view, element_id, &offset, &location);
449 if (status.IsError()) 450 if (status.IsError())
450 return status; 451 return status;
451 value->reset(CreateValueFrom(location)); 452 value->reset(CreateValueFrom(location));
452 return Status(kOk); 453 return Status(kOk);
453 } 454 }
454 455
455 Status ExecuteGetElementSize( 456 Status ExecuteGetElementSize(
456 Session* session, 457 Session* session,
457 WebView* web_view, 458 WebView* web_view,
458 const std::string& element_id, 459 const std::string& element_id,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 WebView* web_view, 503 WebView* web_view,
503 const std::string& element_id, 504 const std::string& element_id,
504 const base::DictionaryValue& params, 505 const base::DictionaryValue& params,
505 scoped_ptr<base::Value>* value) { 506 scoped_ptr<base::Value>* value) {
506 std::string other_element_id; 507 std::string other_element_id;
507 if (!params.GetString("other", &other_element_id)) 508 if (!params.GetString("other", &other_element_id))
508 return Status(kUnknownError, "'other' must be a string"); 509 return Status(kUnknownError, "'other' must be a string");
509 value->reset(new base::FundamentalValue(element_id == other_element_id)); 510 value->reset(new base::FundamentalValue(element_id == other_element_id));
510 return Status(kOk); 511 return Status(kOk);
511 } 512 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/chromedriver/element_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698