| 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_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 Loading... |
| 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 } |
| OLD | NEW |