| 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 CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 // invoke domAutomationController.send(); otherwise, your test will hang or be | 199 // invoke domAutomationController.send(); otherwise, your test will hang or be |
| 200 // flaky. If you want to extract a result, use one of the below functions. | 200 // flaky. If you want to extract a result, use one of the below functions. |
| 201 // Returns true on success. | 201 // Returns true on success. |
| 202 bool ExecuteScript(const ToRenderFrameHost& adapter, | 202 bool ExecuteScript(const ToRenderFrameHost& adapter, |
| 203 const std::string& script) WARN_UNUSED_RESULT; | 203 const std::string& script) WARN_UNUSED_RESULT; |
| 204 | 204 |
| 205 // The following methods executes the passed |script| in the specified frame and | 205 // The following methods executes the passed |script| in the specified frame and |
| 206 // sets |result| to the value passed to "window.domAutomationController.send" by | 206 // sets |result| to the value passed to "window.domAutomationController.send" by |
| 207 // the executed script. They return true on success, false if the script | 207 // the executed script. They return true on success, false if the script |
| 208 // execution failed or did not evaluate to the expected type. | 208 // execution failed or did not evaluate to the expected type. |
| 209 bool ExecuteScriptAndExtractDouble(const ToRenderFrameHost& adapter, |
| 210 const std::string& script, |
| 211 double* result) WARN_UNUSED_RESULT; |
| 209 bool ExecuteScriptAndExtractInt(const ToRenderFrameHost& adapter, | 212 bool ExecuteScriptAndExtractInt(const ToRenderFrameHost& adapter, |
| 210 const std::string& script, | 213 const std::string& script, |
| 211 int* result) WARN_UNUSED_RESULT; | 214 int* result) WARN_UNUSED_RESULT; |
| 212 bool ExecuteScriptAndExtractBool(const ToRenderFrameHost& adapter, | 215 bool ExecuteScriptAndExtractBool(const ToRenderFrameHost& adapter, |
| 213 const std::string& script, | 216 const std::string& script, |
| 214 bool* result) WARN_UNUSED_RESULT; | 217 bool* result) WARN_UNUSED_RESULT; |
| 215 bool ExecuteScriptAndExtractString(const ToRenderFrameHost& adapter, | 218 bool ExecuteScriptAndExtractString(const ToRenderFrameHost& adapter, |
| 216 const std::string& script, | 219 const std::string& script, |
| 217 std::string* result) WARN_UNUSED_RESULT; | 220 std::string* result) WARN_UNUSED_RESULT; |
| 218 | 221 |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 TextInputStateTestExport(const ui::TextInputType& type, | 526 TextInputStateTestExport(const ui::TextInputType& type, |
| 524 const std::string& value); | 527 const std::string& value); |
| 525 | 528 |
| 526 ui::TextInputType type_; | 529 ui::TextInputType type_; |
| 527 std::string value_; | 530 std::string value_; |
| 528 }; | 531 }; |
| 529 | 532 |
| 530 } // namespace content | 533 } // namespace content |
| 531 | 534 |
| 532 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ | 535 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_ |
| OLD | NEW |