shdocvw: OnAmbientPropertyChange should refresh all properties with a DISPID_UNKNOWN.

This commit is contained in:
Alistair Leslie-Hughes 2009-02-03 20:41:16 +11:00 committed by Alexandre Julliard
parent 36a2d5ac3a
commit 69a8066b18
2 changed files with 31 additions and 0 deletions

View File

@ -718,6 +718,11 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS
TRACE("(%p)->(%d)\n", This, dispID);
switch(dispID) {
case DISPID_UNKNOWN:
/* Unknown means multiple properties changed, so check them all. */
on_offlineconnected_change(This);
on_silent_change(This);
return S_OK;
case DISPID_AMBIENT_OFFLINEIFNOTCONNECTED:
return on_offlineconnected_change(This);
case DISPID_AMBIENT_SILENT:

View File

@ -1773,6 +1773,31 @@ static void test_Offline(IWebBrowser2 *wb, IOleControl *control, BOOL is_clients
ok(b == VARIANT_FALSE, "b=%x\n", b);
}
static void test_ambient_unknown(IWebBrowser2 *wb, IOleControl *control, BOOL is_clientsite)
{
HRESULT hres;
SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
SET_EXPECT(Invoke_AMBIENT_SILENT);
SET_EXPECT(Invoke_AMBIENT_USERMODE);
SET_EXPECT(Invoke_AMBIENT_DLCONTROL);
SET_EXPECT(Invoke_AMBIENT_USERAGENT);
SET_EXPECT(Invoke_AMBIENT_PALETTE);
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);
}
}
static void test_wb_funcs(IUnknown *unk, BOOL is_clientsite)
{
IWebBrowser2 *wb;
@ -1787,6 +1812,7 @@ static void test_wb_funcs(IUnknown *unk, BOOL is_clientsite)
test_Silent(wb, control, is_clientsite);
test_Offline(wb, control, is_clientsite);
test_ambient_unknown(wb, control, is_clientsite);
IWebBrowser_Release(wb);
IOleControl_Release(control);