OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_TEST_AUTOMATION_DOM_ELEMENT_PROXY_H_ | 5 #ifndef CHROME_TEST_AUTOMATION_DOM_ELEMENT_PROXY_H_ |
6 #define CHROME_TEST_AUTOMATION_DOM_ELEMENT_PROXY_H_ | 6 #define CHROME_TEST_AUTOMATION_DOM_ELEMENT_PROXY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 // Retrieves the element's id. Returns true on success. | 151 // Retrieves the element's id. Returns true on success. |
152 bool GetId(std::string* id); | 152 bool GetId(std::string* id); |
153 | 153 |
154 // Retrieves the element's name. Returns true on success. | 154 // Retrieves the element's name. Returns true on success. |
155 bool GetName(std::string* name); | 155 bool GetName(std::string* name); |
156 | 156 |
157 // Retrieves the element's visibility. Returns true on success. | 157 // Retrieves the element's visibility. Returns true on success. |
158 bool GetVisibility(bool* visilibity); | 158 bool GetVisibility(bool* visilibity); |
159 | 159 |
160 // Asserts that no elements can be found by the given locator method. | 160 // Returns if |expected_value| eventually matches the element's value for |
161 void EnsureFindNoElements(const By& by); | |
162 | |
163 // Asserts that |expected_text| matches all the text in this element. This | |
164 // includes the value of textfields and inputs. | |
165 void EnsureTextMatches(const std::string& expected_text); | |
166 | |
167 // Asserts that |expected_html| matches the element's inner html. | |
168 void EnsureInnerHTMLMatches(const std::string& expected_html); | |
169 | |
170 // Asserts that |expected_name| matches the element's name. | |
171 void EnsureNameMatches(const std::string& expected_name); | |
172 | |
173 // Asserts that |expected_visibility| matches the element's visibility. | |
174 void EnsureVisibilityMatches(bool expected_visibility); | |
175 | |
176 // Asserts that |expected_value| eventually matches the element's value for | |
177 // |attribute|. This function will block until the timeout is exceeded, in | 161 // |attribute|. This function will block until the timeout is exceeded, in |
178 // which case it will fail, or until the two values match. | 162 // which case it will fail, or until the two values match. |
179 void EnsureAttributeEventuallyMatches(const std::string& attribute, | 163 bool DoesAttributeEventuallyMatch(const std::string& attribute, |
180 const std::string& expected_value); | 164 const std::string& expected_value); |
181 | 165 |
182 private: | 166 private: |
183 // Gets the element's value for the given type. This is a helper method | 167 // Gets the element's value for the given type. This is a helper method |
184 // for simple get methods. | 168 // for simple get methods. |
185 template <typename T> | 169 template <typename T> |
186 bool GetValue(const std::string& type, T* out); | 170 bool GetValue(const std::string& type, T* out); |
187 | 171 |
188 DISALLOW_COPY_AND_ASSIGN(DOMElementProxy); | 172 DISALLOW_COPY_AND_ASSIGN(DOMElementProxy); |
189 }; | 173 }; |
190 | 174 |
191 #endif // CHROME_TEST_AUTOMATION_DOM_ELEMENT_PROXY_H_ | 175 #endif // CHROME_TEST_AUTOMATION_DOM_ELEMENT_PROXY_H_ |
OLD | NEW |