From a14a75b85ebe1a7d15f9a313f9d79a9571037d6c Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 4 Feb 2009 11:51:59 +1100 Subject: [PATCH] shdocvw: Correct OnAmbientPropertyChange regression. --- dlls/shdocvw/oleobject.c | 6 +++--- dlls/shdocvw/tests/webbrowser.c | 25 ++++++++++++++++--------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/dlls/shdocvw/oleobject.c b/dlls/shdocvw/oleobject.c index cd5e605b1b9..a38d03d0e22 100644 --- a/dlls/shdocvw/oleobject.c +++ b/dlls/shdocvw/oleobject.c @@ -719,9 +719,9 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS switch(dispID) { case DISPID_UNKNOWN: - /* Unknown means multiple properties changed, so check them all. */ - on_offlineconnected_change(This); - on_silent_change(This); + /* Unknown means multiple properties changed, so check them all. + * BUT the Webbrowser OleControl object doesnt appear to do this. + */ return S_OK; case DISPID_AMBIENT_OFFLINEIFNOTCONNECTED: return on_offlineconnected_change(This); diff --git a/dlls/shdocvw/tests/webbrowser.c b/dlls/shdocvw/tests/webbrowser.c index 27cd353c702..64c5bab2f6f 100644 --- a/dlls/shdocvw/tests/webbrowser.c +++ b/dlls/shdocvw/tests/webbrowser.c @@ -69,6 +69,9 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); expect_ ## func = called_ ## func = FALSE; \ }while(0) +#define CLEAR_CALLED(func) \ + expect_ ## func = called_ ## func = FALSE + DEFINE_EXPECT(GetContainer); DEFINE_EXPECT(Site_GetWindow); DEFINE_EXPECT(ShowObject); @@ -1787,15 +1790,19 @@ static void test_ambient_unknown(IWebBrowser2 *wb, IOleControl *control, BOOL is hres = IOleControl_OnAmbientPropertyChange(control, DISPID_UNKNOWN); ok(hres == S_OK, "OnAmbientPropertyChange failed %08x\n", hres); - if(is_clientsite) - { - CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); - CHECK_CALLED(Invoke_AMBIENT_SILENT); - todo_wine CHECK_CALLED(Invoke_AMBIENT_USERMODE); - todo_wine CHECK_CALLED(Invoke_AMBIENT_DLCONTROL); - todo_wine CHECK_CALLED(Invoke_AMBIENT_USERAGENT); - todo_wine CHECK_CALLED(Invoke_AMBIENT_PALETTE); - } + CHECK_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); + CHECK_EXPECT(Invoke_AMBIENT_SILENT); + CHECK_EXPECT(Invoke_AMBIENT_USERMODE); + CHECK_EXPECT(Invoke_AMBIENT_DLCONTROL); + CHECK_EXPECT(Invoke_AMBIENT_USERAGENT); + CHECK_EXPECT(Invoke_AMBIENT_PALETTE); + + CLEAR_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED); + CLEAR_CALLED(Invoke_AMBIENT_SILENT); + CLEAR_CALLED(Invoke_AMBIENT_USERMODE); + CLEAR_CALLED(Invoke_AMBIENT_DLCONTROL); + CLEAR_CALLED(Invoke_AMBIENT_USERAGENT); + CLEAR_CALLED(Invoke_AMBIENT_PALETTE); } static void test_wb_funcs(IUnknown *unk, BOOL is_clientsite)