Chromium Code Reviews| 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 'name'"); |
|
kkania
2013/04/18 00:38:52
propertyName
chrisgao (Use stgao instead)
2013/04/18 01:39:48
Done.
| |
| 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->GetCurrentFrameId(), web_view, element_id, |
| 422 value); | 422 property_name, &property_value); |
| 423 if (status.IsError()) | |
| 424 return status; | |
| 425 value->reset(new base::StringValue(property_value)); | |
| 426 return Status(kOk); | |
| 423 } | 427 } |
| 424 | 428 |
| 425 Status ExecuteElementEquals( | 429 Status ExecuteElementEquals( |
| 426 Session* session, | 430 Session* session, |
| 427 WebView* web_view, | 431 WebView* web_view, |
| 428 const std::string& element_id, | 432 const std::string& element_id, |
| 429 const base::DictionaryValue& params, | 433 const base::DictionaryValue& params, |
| 430 scoped_ptr<base::Value>* value) { | 434 scoped_ptr<base::Value>* value) { |
| 431 std::string other_element_id; | 435 std::string other_element_id; |
| 432 if (!params.GetString("other", &other_element_id)) | 436 if (!params.GetString("other", &other_element_id)) |
| 433 return Status(kUnknownError, "'other' must be a string"); | 437 return Status(kUnknownError, "'other' must be a string"); |
| 434 value->reset(new base::FundamentalValue(element_id == other_element_id)); | 438 value->reset(new base::FundamentalValue(element_id == other_element_id)); |
| 435 return Status(kOk); | 439 return Status(kOk); |
| 436 } | 440 } |
| OLD | NEW |