shdocvw/tests: Need to save .url before committing extra props for IE6.

This commit is contained in:
Greg Geldorp 2010-12-23 13:19:40 +01:00 committed by Alexandre Julliard
parent c6682ef5dc
commit e2ce3cffe3
2 changed files with 26 additions and 16 deletions

View file

@ -610,7 +610,13 @@ static HRESULT WINAPI PersistFile_Save(IPersistFile *pFile, LPCOLESTR pszFileNam
if SUCCEEDED(hr)
{
hr = IPropertyStorage_ReadMultiple(pPropStgRead, 2, ps, pvread);
if SUCCEEDED(hr)
if (hr == S_FALSE)
{
/* None of the properties are present, that's ok */
hr = S_OK;
IPropertyStorage_Release(pPropStgRead);
}
else if SUCCEEDED(hr)
{
char indexString[50];
len = WideCharToMultiByte(CP_UTF8, 0, pvread[0].u.pwszVal, -1, NULL, 0, 0, 0);

View file

@ -200,6 +200,20 @@ static void test_ReadAndWriteProperties(void)
IPropertyStorage *pPropStgWrite;
IPropertySetStorage *pPropSetStg;
PROPVARIANT pv[2];
/* We need to set a URL -- IPersistFile refuses to save without one. */
hr = urlA->lpVtbl->SetURL(urlA, testurl, 0);
ok(hr == S_OK, "Failed to set a URL. hr=0x%x\n", hr);
/* Write this shortcut out to a file so that we can test reading it in again. */
hr = urlA->lpVtbl->QueryInterface(urlA, &IID_IPersistFile, (void **) &pf);
ok(hr == S_OK, "Failed to get the IPersistFile for writing. hr=0x%x\n", hr);
hr = IPersistFile_Save(pf, fileNameW, TRUE);
ok(hr == S_OK, "Failed to save via IPersistFile. hr=0x%x\n", hr);
IPersistFile_Release(pf);
pv[0].vt = VT_LPWSTR;
pv[0].pwszVal = (void *) iconPath;
pv[1].vt = VT_I4;
@ -217,19 +231,6 @@ static void test_ReadAndWriteProperties(void)
ok(hr == S_OK, "Failed to commit properties, hr=0x%x\n", hr);
pPropStgWrite->lpVtbl->Release(pPropStgWrite);
/* We need to set a URL -- IPersistFile refuses to save without one. */
hr = urlA->lpVtbl->SetURL(urlA, testurl, 0);
ok(hr == S_OK, "Failed to set a URL. hr=0x%x\n", hr);
/* Write this shortcut out to a file so that we can test reading it in again. */
hr = urlA->lpVtbl->QueryInterface(urlA, &IID_IPersistFile, (void **) &pf);
ok(hr == S_OK, "Failed to get the IPersistFile for writing. hr=0x%x\n", hr);
hr = IPersistFile_Save(pf, fileNameW, TRUE);
ok(hr == S_OK, "Failed to save via IPersistFile. hr=0x%x\n", hr);
IPersistFile_Release(pf);
urlA->lpVtbl->Release(urlA);
IPropertySetStorage_Release(pPropSetStg);
}
@ -267,9 +268,12 @@ static void test_ReadAndWriteProperties(void)
hr = IPropertyStorage_ReadMultiple(pPropStgRead, 2, ps, pvread);
ok(hr == S_OK, "Unable to read properties, hr=0x%x\n", hr);
ok(pvread[1].iVal == iconIndex, "Read wrong icon index: %d\n", pvread[1].iVal);
todo_wine /* Wine doesn't yet support setting properties after save */
{
ok(pvread[1].iVal == iconIndex, "Read wrong icon index: %d\n", pvread[1].iVal);
ok(lstrcmpW(pvread[0].pwszVal, iconPath) == 0, "Wrong icon path read: %s\n",wine_dbgstr_w(pvread[0].pwszVal));
ok(lstrcmpW(pvread[0].pwszVal, iconPath) == 0, "Wrong icon path read: %s\n",wine_dbgstr_w(pvread[0].pwszVal));
}
PropVariantClear(&pvread[0]);
PropVariantClear(&pvread[1]);