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

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

Issue 14188022: [chromedriver] Fix bug in command for GetElementValueOfCSSProperty. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 7 years, 8 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 | Annotate | Revision Log
« 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 <list> 7 #include <list>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 return Status(kUnknownError, "missing 'name'"); 406 return Status(kUnknownError, "missing 'name'");
407 return GetElementAttribute(session, web_view, element_id, name, value); 407 return GetElementAttribute(session, web_view, element_id, name, value);
408 } 408 }
409 409
410 Status ExecuteGetElementValueOfCSSProperty( 410 Status ExecuteGetElementValueOfCSSProperty(
411 Session* session, 411 Session* session,
412 WebView* web_view, 412 WebView* web_view,
413 const std::string& element_id, 413 const std::string& element_id,
414 const base::DictionaryValue& params, 414 const base::DictionaryValue& params,
415 scoped_ptr<base::Value>* value) { 415 scoped_ptr<base::Value>* value) {
416 base::ListValue args; 416 std::string property_name;
417 args.Append(CreateElement(element_id)); 417 if (!params.GetString("propertyName", &property_name))
418 return web_view->CallFunction( 418 return Status(kUnknownError, "missing 'propertyName'");
419 session->GetCurrentFrameId(), 419 std::string property_value;
420 webdriver::atoms::asString(webdriver::atoms::GET_EFFECTIVE_STYLE), 420 Status status = GetElementEffectiveStyle(
421 args, 421 session, web_view, element_id, property_name, &property_value);
422 value); 422 if (status.IsError())
423 return status;
424 value->reset(new base::StringValue(property_value));
425 return Status(kOk);
423 } 426 }
424 427
425 Status ExecuteElementEquals( 428 Status ExecuteElementEquals(
426 Session* session, 429 Session* session,
427 WebView* web_view, 430 WebView* web_view,
428 const std::string& element_id, 431 const std::string& element_id,
429 const base::DictionaryValue& params, 432 const base::DictionaryValue& params,
430 scoped_ptr<base::Value>* value) { 433 scoped_ptr<base::Value>* value) {
431 std::string other_element_id; 434 std::string other_element_id;
432 if (!params.GetString("other", &other_element_id)) 435 if (!params.GetString("other", &other_element_id))
433 return Status(kUnknownError, "'other' must be a string"); 436 return Status(kUnknownError, "'other' must be a string");
434 value->reset(new base::FundamentalValue(element_id == other_element_id)); 437 value->reset(new base::FundamentalValue(element_id == other_element_id));
435 return Status(kOk); 438 return Status(kOk);
436 } 439 }
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