summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/chrome_frame_unittests.h
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-09 01:09:28 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-09 01:09:28 +0000
commit7bc272f38646abb81b58c89a59d8e6842f9e9631 (patch)
tree8e3c884ad1549c445e86925df673fcd0d8285d1d /chrome_frame/test/chrome_frame_unittests.h
parent0923559a1a020690c1d199fda3c55f67d2d54335 (diff)
downloadchromium_src-7bc272f38646abb81b58c89a59d8e6842f9e9631.zip
chromium_src-7bc272f38646abb81b58c89a59d8e6842f9e9631.tar.gz
chromium_src-7bc272f38646abb81b58c89a59d8e6842f9e9631.tar.bz2
Added support for running reliability tests for ChromeFrame on similar lines as Chrome. We only run these
tests for IE at this point. The reliability test code for Chrome has been copied and modified accordingly. Other related changes in this CL include the following:- 1. If ChromeFrame is running in headless mode determined by a registry value in HKCU\Software\Google\ChromeFrame we initialize ChromeFrame crash reporting and connect to the Chrome crash server. This would enable us to gather crash dumps from the reliability test runs and report the same. 2. The LowIntegrity fixes for the WebBrowser which Stoyan had done a while back are only needed for IE7 on Vista. For this CL though we just do the requisite hacks if the OS is Vista. For Windows7 the returned IWebBrowser interface pointer works fine. 3. I moved the WebBrowserEventSink to chrome_frame_test_utils as this class is now shared. Fixes portions of http://code.google.com/p/chromium/issues/detail?id=29451 Bug=29451 Review URL: http://codereview.chromium.org/465074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34119 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/chrome_frame_unittests.h')
-rw-r--r--chrome_frame/test/chrome_frame_unittests.h127
1 files changed, 0 insertions, 127 deletions
diff --git a/chrome_frame/test/chrome_frame_unittests.h b/chrome_frame/test/chrome_frame_unittests.h
index b009faf..f5bd3cb 100644
--- a/chrome_frame/test/chrome_frame_unittests.h
+++ b/chrome_frame/test/chrome_frame_unittests.h
@@ -104,132 +104,5 @@ class ChromeFrameTestWithWebServer: public testing::Test {
ChromeFrameHTTPServer server_;
};
-// This class sets up event sinks to the IWebBrowser interface. Currently it
-// subscribes to the following events:-
-// 1. DISPID_BEFORENAVIGATE2
-// 2. DISPID_NAVIGATEERROR
-// 3. DISPID_NAVIGATECOMPLETE2
-// 4. DISPID_NEWWINDOW3
-// Other events can be subscribed to on an if needed basis.
-class WebBrowserEventSink
- : public CComObjectRootEx<CComSingleThreadModel>,
- public IDispEventSimpleImpl<0, WebBrowserEventSink,
- &DIID_DWebBrowserEvents2> {
- public:
- typedef IDispEventSimpleImpl<0, WebBrowserEventSink,
- &DIID_DWebBrowserEvents2> DispEventsImpl;
- WebBrowserEventSink()
- : ALLOW_THIS_IN_INITIALIZER_LIST(
- onmessage_(this, &WebBrowserEventSink::OnMessageInternal)),
- ALLOW_THIS_IN_INITIALIZER_LIST(
- onloaderror_(this, &WebBrowserEventSink::OnLoadErrorInternal)),
- ALLOW_THIS_IN_INITIALIZER_LIST(
- onload_(this, &WebBrowserEventSink::OnLoadInternal)) {
- }
-
- ~WebBrowserEventSink() {
- Uninitialize();
- }
-
- void Uninitialize();
-
- // Helper function to launch IE and navigate to a URL.
- // Returns S_OK on success, S_FALSE if the test was not run, other
- // errors on failure.
- HRESULT LaunchIEAndNavigate(const std::wstring& navigate_url);
-
- HRESULT Navigate(const std::wstring& navigate_url);
-
- // Set input focus to chrome frame window.
- void SetFocusToChrome();
-
- // Send keyboard input to the renderer window hosted in chrome using
- // SendInput API
- void SendInputToChrome(const std::string& input_string);
-
-BEGIN_COM_MAP(WebBrowserEventSink)
-END_COM_MAP()
-
-BEGIN_SINK_MAP(WebBrowserEventSink)
- SINK_ENTRY_INFO(0, DIID_DWebBrowserEvents2, DISPID_BEFORENAVIGATE2,
- OnBeforeNavigate2Internal, &kBeforeNavigate2Info)
- SINK_ENTRY_INFO(0, DIID_DWebBrowserEvents2, DISPID_DOWNLOADBEGIN,
- OnDownloadBegin, &kVoidMethodInfo)
- SINK_ENTRY_INFO(0, DIID_DWebBrowserEvents2, DISPID_NAVIGATECOMPLETE2,
- OnNavigateComplete2Internal, &kNavigateComplete2Info)
- SINK_ENTRY_INFO(0, DIID_DWebBrowserEvents2, DISPID_NAVIGATEERROR,
- OnNavigateError, &kNavigateErrorInfo)
- SINK_ENTRY_INFO(0, DIID_DWebBrowserEvents2, DISPID_NEWWINDOW3,
- OnNewWindow3, &kNewWindow3Info)
-END_SINK_MAP()
-
- STDMETHOD_(void, OnNavigateError)(IDispatch* dispatch, VARIANT* url,
- VARIANT* frame_name, VARIANT* status_code,
- VARIANT* cancel) {
- DLOG(INFO) << __FUNCTION__;
- }
-
- STDMETHOD(OnBeforeNavigate2)(IDispatch* dispatch, VARIANT* url, VARIANT*
- flags, VARIANT* target_frame_name,
- VARIANT* post_data, VARIANT* headers,
- VARIANT_BOOL* cancel) {
- return S_OK;
- }
-
- STDMETHOD(OnBeforeNavigate2Internal)(IDispatch* dispatch, VARIANT* url,
- VARIANT* flags,
- VARIANT* target_frame_name,
- VARIANT* post_data, VARIANT* headers,
- VARIANT_BOOL* cancel);
- STDMETHOD_(void, OnDownloadBegin)() {}
- STDMETHOD_(void, OnNavigateComplete2Internal)(IDispatch* dispatch,
- VARIANT* url);
- STDMETHOD_(void, OnNavigateComplete2)(IDispatch* dispatch, VARIANT* url) {}
- STDMETHOD_(void, OnNewWindow3)(IDispatch** dispatch, VARIANT_BOOL* Cancel,
- DWORD flags, BSTR url_context, BSTR url) {}
-
-#ifdef _DEBUG
- STDMETHOD(Invoke)(DISPID dispid, REFIID riid,
- LCID lcid, WORD flags, DISPPARAMS* params, VARIANT* result,
- EXCEPINFO* except_info, UINT* arg_error) {
- DLOG(INFO) << __FUNCTION__ << L" disp id :" << dispid;
- return DispEventsImpl::Invoke(dispid, riid, lcid, flags, params, result,
- except_info, arg_error);
- }
-#endif // _DEBUG
-
- // Chrome frame callbacks
- virtual void OnLoad(const wchar_t* url) {}
- virtual void OnLoadError(const wchar_t* url) {}
- virtual void OnMessage(const wchar_t* message) {}
-
- IWebBrowser2* web_browser2() {
- return web_browser2_.get();
- }
-
- protected:
- // IChromeFrame callbacks
- HRESULT OnLoadInternal(const VARIANT* param);
- HRESULT OnLoadErrorInternal(const VARIANT* param);
- HRESULT OnMessageInternal(const VARIANT* param);
-
- void ConnectToChromeFrame();
- HWND GetChromeRendererWindow();
-
- public:
- ScopedComPtr<IWebBrowser2> web_browser2_;
- ScopedComPtr<IChromeFrame> chrome_frame_;
- DispCallback<WebBrowserEventSink> onmessage_;
- DispCallback<WebBrowserEventSink> onloaderror_;
- DispCallback<WebBrowserEventSink> onload_;
-
- protected:
- static _ATL_FUNC_INFO kBeforeNavigate2Info;
- static _ATL_FUNC_INFO kNavigateComplete2Info;
- static _ATL_FUNC_INFO kNavigateErrorInfo;
- static _ATL_FUNC_INFO kNewWindow3Info;
- static _ATL_FUNC_INFO kVoidMethodInfo;
-};
-
#endif // CHROME_FRAME_TEST_CHROME_FRAME_UNITTESTS_H_