ieframe: Added partial Refresh2 implementation.

This commit is contained in:
Jacek Caban 2014-09-25 13:38:24 +02:00 committed by Alexandre Julliard
parent dae9096c2e
commit c1acf1647b
5 changed files with 32 additions and 12 deletions

View File

@ -532,12 +532,15 @@ void deactivate_document(DocHost *This)
This->document = NULL;
}
HRESULT refresh_document(DocHost *This)
HRESULT refresh_document(DocHost *This, const VARIANT *level)
{
IOleCommandTarget *cmdtrg;
VARIANT vin, vout;
HRESULT hres;
if(level && (V_VT(level) != VT_I4 || V_I4(level) != REFRESH_NORMAL))
FIXME("Unsupported refresh level %s\n", debugstr_variant(level));
if(!This->document) {
FIXME("no document\n");
return E_FAIL;

View File

@ -182,14 +182,16 @@ static HRESULT WINAPI InternetExplorer_Refresh(IWebBrowser2 *iface)
TRACE("(%p)\n", This);
return refresh_document(&This->doc_host);
return refresh_document(&This->doc_host, NULL);
}
static HRESULT WINAPI InternetExplorer_Refresh2(IWebBrowser2 *iface, VARIANT *Level)
{
InternetExplorer *This = impl_from_IWebBrowser2(iface);
FIXME("(%p)->(%p)\n", This, Level);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, Level);
return refresh_document(&This->doc_host, Level);
}
static HRESULT WINAPI InternetExplorer_Stop(IWebBrowser2 *iface)

View File

@ -265,7 +265,7 @@ HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VAR
HRESULT go_home(DocHost*) DECLSPEC_HIDDEN;
HRESULT go_back(DocHost*) DECLSPEC_HIDDEN;
HRESULT go_forward(DocHost*) DECLSPEC_HIDDEN;
HRESULT refresh_document(DocHost*) DECLSPEC_HIDDEN;
HRESULT refresh_document(DocHost*,const VARIANT*) DECLSPEC_HIDDEN;
HRESULT get_location_url(DocHost*,BSTR*) DECLSPEC_HIDDEN;
HRESULT set_dochost_url(DocHost*,const WCHAR*) DECLSPEC_HIDDEN;
void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDEN;

View File

@ -2835,15 +2835,27 @@ static void test_download(DWORD flags)
CLEAR_CALLED(QueryStatus_STOP);
}
static void test_Refresh(IWebBrowser2 *webbrowser)
static void test_Refresh(IWebBrowser2 *webbrowser, BOOL use_refresh2)
{
HRESULT hres;
trace("Refresh...\n");
SET_EXPECT(Exec_DocHostCommandHandler_2300);
hres = IWebBrowser2_Refresh(webbrowser);
ok(hres == S_OK, "Refresh failed: %08x\n", hres);
if(use_refresh2) {
VARIANT v;
V_VT(&v) = VT_I4;
V_I4(&v) = REFRESH_NORMAL;
hres = IWebBrowser2_Refresh2(webbrowser, &v);
ok(hres == S_OK, "Refresh failed: %08x\n", hres);
}else {
hres = IWebBrowser2_Refresh(webbrowser);
ok(hres == S_OK, "Refresh failed: %08x\n", hres);
}
CHECK_CALLED(Exec_DocHostCommandHandler_2300);
test_download(DWL_REFRESH);
@ -3423,7 +3435,8 @@ static void test_WebBrowser(BOOL do_download, BOOL do_close)
test_Navigate2(webbrowser, "http://test.winehq.org/tests/hello.html");
test_download(DWL_EXPECT_BEFORE_NAVIGATE|DWL_HTTP);
test_Refresh(webbrowser);
test_Refresh(webbrowser, FALSE);
test_Refresh(webbrowser, TRUE);
trace("put_href http URL...\n");
test_put_href(webbrowser, "http://test.winehq.org/tests/winehq_snapshot/");

View File

@ -296,14 +296,16 @@ static HRESULT WINAPI WebBrowser_Refresh(IWebBrowser2 *iface)
TRACE("(%p)\n", This);
return refresh_document(&This->doc_host);
return refresh_document(&This->doc_host, NULL);
}
static HRESULT WINAPI WebBrowser_Refresh2(IWebBrowser2 *iface, VARIANT *Level)
{
WebBrowser *This = impl_from_IWebBrowser2(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(Level));
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_variant(Level));
return refresh_document(&This->doc_host, Level);
}
static HRESULT WINAPI WebBrowser_Stop(IWebBrowser2 *iface)