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_RENDER_VIEW_TEST_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ |
6 #define CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ | 6 #define CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // is a NULL-terminated UTF-8 string. | 66 // is a NULL-terminated UTF-8 string. |
67 void ExecuteJavaScript(const char* js); | 67 void ExecuteJavaScript(const char* js); |
68 | 68 |
69 // Executes the given JavaScript and sets the int value it evaluates to in | 69 // Executes the given JavaScript and sets the int value it evaluates to in |
70 // |result|. | 70 // |result|. |
71 // Returns true if the JavaScript was evaluated correctly to an int value, | 71 // Returns true if the JavaScript was evaluated correctly to an int value, |
72 // false otherwise. | 72 // false otherwise. |
73 bool ExecuteJavaScriptAndReturnIntValue(const base::string16& script, | 73 bool ExecuteJavaScriptAndReturnIntValue(const base::string16& script, |
74 int* result); | 74 int* result); |
75 | 75 |
| 76 // Executes the given JavaScript and sets the string value it evaluates to in |
| 77 // |result|. |
| 78 // Returns true if the JavaScript was evaluated correctly to an string value, |
| 79 // false otherwise. |
| 80 bool ExecuteJavaScriptAndReturnStringValue(const base::string16& script, |
| 81 std::string& result); |
| 82 |
76 // Loads the given HTML into the main frame as a data: URL and blocks until | 83 // Loads the given HTML into the main frame as a data: URL and blocks until |
77 // the navigation is committed. | 84 // the navigation is committed. |
78 void LoadHTML(const char* html); | 85 void LoadHTML(const char* html); |
79 | 86 |
80 // Returns the current PageState. | 87 // Returns the current PageState. |
81 PageState GetCurrentPageState(); | 88 PageState GetCurrentPageState(); |
82 | 89 |
83 // Navigates the main frame back or forward in session history and commits. | 90 // Navigates the main frame back or forward in session history and commits. |
84 // The caller must capture a PageState for the target page. | 91 // The caller must capture a PageState for the target page. |
85 void GoBack(const PageState& state); | 92 void GoBack(const PageState& state); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 scoped_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool_; | 164 scoped_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool_; |
158 #endif | 165 #endif |
159 | 166 |
160 private: | 167 private: |
161 void GoToOffset(int offset, const PageState& state); | 168 void GoToOffset(int offset, const PageState& state); |
162 }; | 169 }; |
163 | 170 |
164 } // namespace content | 171 } // namespace content |
165 | 172 |
166 #endif // CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ | 173 #endif // CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ |
OLD | NEW |