OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BASE_UI_TEST_UTILS_H_ | 5 #ifndef CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
6 #define CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 6 #define CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // Returns true on success. | 164 // Returns true on success. |
165 bool ExecuteJavaScript(content::RenderViewHost* render_view_host, | 165 bool ExecuteJavaScript(content::RenderViewHost* render_view_host, |
166 const std::wstring& frame_xpath, | 166 const std::wstring& frame_xpath, |
167 const std::wstring& script) WARN_UNUSED_RESULT; | 167 const std::wstring& script) WARN_UNUSED_RESULT; |
168 | 168 |
169 // The following methods executes the passed |script| in the frame pointed to by | 169 // The following methods executes the passed |script| in the frame pointed to by |
170 // |frame_xpath| (use empty string for main frame) and sets |result| to the | 170 // |frame_xpath| (use empty string for main frame) and sets |result| to the |
171 // value returned by the script evaluation. | 171 // value returned by the script evaluation. |
172 // They return true on success, false if the script evaluation failed or did not | 172 // They return true on success, false if the script evaluation failed or did not |
173 // evaluate to the expected type. | 173 // evaluate to the expected type. |
174 // Note: In order for the domAutomationController to work, you must call | |
175 // EnableDOMAutomation() in your test first. | |
176 bool ExecuteJavaScriptAndExtractInt(content::RenderViewHost* render_view_host, | 174 bool ExecuteJavaScriptAndExtractInt(content::RenderViewHost* render_view_host, |
177 const std::wstring& frame_xpath, | 175 const std::wstring& frame_xpath, |
178 const std::wstring& script, | 176 const std::wstring& script, |
179 int* result) WARN_UNUSED_RESULT; | 177 int* result) WARN_UNUSED_RESULT; |
180 bool ExecuteJavaScriptAndExtractBool(content::RenderViewHost* render_view_host, | 178 bool ExecuteJavaScriptAndExtractBool(content::RenderViewHost* render_view_host, |
181 const std::wstring& frame_xpath, | 179 const std::wstring& frame_xpath, |
182 const std::wstring& script, | 180 const std::wstring& script, |
183 bool* result) WARN_UNUSED_RESULT; | 181 bool* result) WARN_UNUSED_RESULT; |
184 bool ExecuteJavaScriptAndExtractString( | 182 bool ExecuteJavaScriptAndExtractString( |
185 content::RenderViewHost* render_view_host, | 183 content::RenderViewHost* render_view_host, |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 // ui_controls_linux.cc and ui_controls_mac.cc | 693 // ui_controls_linux.cc and ui_controls_mac.cc |
696 void ClickTask(ui_controls::MouseButton button, | 694 void ClickTask(ui_controls::MouseButton button, |
697 int state, | 695 int state, |
698 const base::Closure& followup); | 696 const base::Closure& followup); |
699 | 697 |
700 } // namespace internal | 698 } // namespace internal |
701 | 699 |
702 } // namespace ui_test_utils | 700 } // namespace ui_test_utils |
703 | 701 |
704 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 702 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
OLD | NEW |