| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 blink::WebFrame* GetMainFrame(); | 59 blink::WebFrame* GetMainFrame(); |
| 60 | 60 |
| 61 // Executes the given JavaScript in the context of the main frame. The input | 61 // Executes the given JavaScript in the context of the main frame. The input |
| 62 // is a NULL-terminated UTF-8 string. | 62 // is a NULL-terminated UTF-8 string. |
| 63 void ExecuteJavaScript(const char* js); | 63 void ExecuteJavaScript(const char* js); |
| 64 | 64 |
| 65 // Executes the given JavaScript and sets the int value it evaluates to in | 65 // Executes the given JavaScript and sets the int value it evaluates to in |
| 66 // |result|. | 66 // |result|. |
| 67 // Returns true if the JavaScript was evaluated correctly to an int value, | 67 // Returns true if the JavaScript was evaluated correctly to an int value, |
| 68 // false otherwise. | 68 // false otherwise. |
| 69 bool ExecuteJavaScriptAndReturnIntValue(const string16& script, int* result); | 69 bool ExecuteJavaScriptAndReturnIntValue(const base::string16& script, |
| 70 int* result); |
| 70 | 71 |
| 71 // Loads the given HTML into the main frame as a data: URL and blocks until | 72 // Loads the given HTML into the main frame as a data: URL and blocks until |
| 72 // the navigation is committed. | 73 // the navigation is committed. |
| 73 void LoadHTML(const char* html); | 74 void LoadHTML(const char* html); |
| 74 | 75 |
| 75 // Navigates the main frame back or forward in session history and commits. | 76 // Navigates the main frame back or forward in session history and commits. |
| 76 // The caller must capture a WebHistoryItem for the target page. This is | 77 // The caller must capture a WebHistoryItem for the target page. This is |
| 77 // available from the WebFrame. | 78 // available from the WebFrame. |
| 78 void GoBack(const blink::WebHistoryItem& item); | 79 void GoBack(const blink::WebHistoryItem& item); |
| 79 void GoForward(const blink::WebHistoryItem& item); | 80 void GoForward(const blink::WebHistoryItem& item); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 scoped_ptr<MainFunctionParams> params_; | 139 scoped_ptr<MainFunctionParams> params_; |
| 139 scoped_ptr<CommandLine> command_line_; | 140 scoped_ptr<CommandLine> command_line_; |
| 140 | 141 |
| 141 private: | 142 private: |
| 142 void GoToOffset(int offset, const blink::WebHistoryItem& history_item); | 143 void GoToOffset(int offset, const blink::WebHistoryItem& history_item); |
| 143 }; | 144 }; |
| 144 | 145 |
| 145 } // namespace content | 146 } // namespace content |
| 146 | 147 |
| 147 #endif // CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ | 148 #endif // CONTENT_PUBLIC_TEST_RENDER_VIEW_TEST_H_ |
| OLD | NEW |