Chromium Code Reviews| Index: Source/web/tests/FrameTestHelpers.h |
| diff --git a/Source/web/tests/FrameTestHelpers.h b/Source/web/tests/FrameTestHelpers.h |
| index fa6200739a2ee02d52ac47fa2cef3b3745c9f881..96303e8dddfa8a97eb6984aaee179d71d40c29ab 100644 |
| --- a/Source/web/tests/FrameTestHelpers.h |
| +++ b/Source/web/tests/FrameTestHelpers.h |
| @@ -31,24 +31,45 @@ |
| #ifndef FrameTestHelpers_h |
| #define FrameTestHelpers_h |
| -#include <string> |
| +#include "WebViewImpl.h" |
| #include "wtf/PassOwnPtr.h" |
| +#include <string> |
|
dcheng
2013/09/20 02:29:59
Hm... should #include <string> be at the top of th
awong
2013/09/20 23:57:14
I have no clue. This is what passed the blink styl
|
| namespace WebKit { |
| -class WebFrame; |
| +class WebFrameImpl; |
| class WebFrameClient; |
| -class WebView; |
| +class WebSettings; |
| class WebViewClient; |
| namespace FrameTestHelpers { |
| void loadFrame(WebFrame*, const std::string& url); |
| +void runPendingTasks(); |
| -WebView* createWebView(bool enableJavascript = false, WebFrameClient* = 0, WebViewClient* = 0); |
| -WebView* createWebViewAndLoad(const std::string& url, bool enableJavascript = false, WebFrameClient* = 0, WebViewClient* = 0); |
| +// Convenience class for handling the lifetime of a WebView and its associated mainframe in tests. |
| +class WebViewHelper { |
|
dcheng
2013/09/20 02:29:59
WTF_MAKE_NONCOPYABLE?
awong
2013/09/20 23:57:14
Done.
|
| +public: |
| + WebViewHelper(); |
| + ~WebViewHelper(); |
| -void runPendingTasks(); |
| + // Creates and initializes the WebView. Implicitly calls reset() first. IF a |
| + // WebFrameClient or a WebViewClient are passed in, they must outlive the |
| + // WebViewHelper. |
| + WebViewImpl* initialize(bool enableJavascript = false, WebFrameClient* = 0, WebViewClient* = 0, void (*updateSettingsFunc)(WebSettings*) = 0); |
| + |
| + // Same as initialize() but also performs the initial load of the url. |
| + WebViewImpl* initializeAndLoad(const std::string& url, bool enableJavascript = false, WebFrameClient* = 0, WebViewClient* = 0, void (*updateSettingsFunc)(WebSettings*) = 0); |
| + |
| + void reset(); |
| + |
| + WebView* webView() const { return m_webView; } |
| + WebViewImpl* webViewImpl() const { return m_webView; } |
| + |
| +private: |
| + WebFrameImpl* m_mainFrame; |
| + WebViewImpl* m_webView; |
| +}; |
| } // namespace FrameTestHelpers |
| } // namespace WebKit |