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
3 // found in the LICENSE file.
5 #ifndef CHROME_TEST_CHROMEDRIVER_ELEMENT_UTIL_H_
6 #define CHROME_TEST_CHROMEDRIVER_ELEMENT_UTIL_H_
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/test/chromedriver/basic_types.h"
14 class DictionaryValue;
23 base::DictionaryValue* CreateElement(const std::string& element_id);
25 base::Value* CreateValueFrom(const WebPoint& point);
27 // |root_element_id| could be null when no root element is given.
31 const std::string* root_element_id,
34 const base::DictionaryValue& params,
35 scoped_ptr<base::Value>* value);
37 Status GetActiveElement(
40 scoped_ptr<base::Value>* value);
42 Status IsElementFocused(
45 const std::string& element_id,
48 Status GetElementAttribute(
51 const std::string& element_id,
52 const std::string& attribute_name,
53 scoped_ptr<base::Value>* value);
55 Status IsElementAttributeEqualToIgnoreCase(
58 const std::string& element_id,
59 const std::string& attribute_name,
60 const std::string& attribute_value,
63 Status GetElementClickableLocation(
66 const std::string& element_id,
69 Status GetElementEffectiveStyle(
72 const std::string& element_id,
73 const std::string& property_name,
74 std::string* property_value);
76 Status GetElementRegion(
79 const std::string& element_id,
82 Status GetElementTagName(
85 const std::string& element_id,
88 Status GetElementSize(
91 const std::string& element_id,
94 Status IsElementDisplayed(
97 const std::string& element_id,
101 Status IsElementEnabled(
104 const std::string& element_id,
107 Status IsOptionElementSelected(
110 const std::string& element_id,
113 Status IsOptionElementTogglable(
116 const std::string& element_id,
119 Status SetOptionElementSelected(
122 const std::string& element_id,
125 Status ToggleOptionElement(
128 const std::string& element_id);
130 Status ScrollElementIntoView(
133 const std::string& element_id,
136 // |element_id| refers to the element which is to be scrolled into view.
137 // |clickable_element_id| refers to the element needing clickable verification.
138 // They are usually the same, but can be different. This is useful when an image
139 // uses map/area. The image is scrolled, but check clickable against the area.
140 // If |clickable_element_id| is "", no verification will be performed.
141 Status ScrollElementRegionIntoView(
144 const std::string& element_id,
145 const WebRect& region,
147 const std::string& clickable_element_id,
150 #endif // CHROME_TEST_CHROMEDRIVER_ELEMENT_UTIL_H_