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

Alexandre Julliard julliard at winehq.org
Thu Dec 23 11:28:06 CST 2010


Module: wine
Branch: master
Commit: e2ce3cffe31fc79614f4ecd648ae444e1af055e7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e2ce3cffe31fc79614f4ecd648ae444e1af055e7

Author: Greg Geldorp <ggeldorp at vmware.com>
Date:   Thu Dec 23 13:19:40 2010 +0100

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

---

 dlls/shdocvw/intshcut.c       |    8 +++++++-
 dlls/shdocvw/tests/intshcut.c |   34 +++++++++++++++++++---------------
 2 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/dlls/shdocvw/intshcut.c b/dlls/shdocvw/intshcut.c
index 9820fec..6658c5d 100644
--- a/dlls/shdocvw/intshcut.c
+++ b/dlls/shdocvw/intshcut.c
@@ -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);
diff --git a/dlls/shdocvw/tests/intshcut.c b/dlls/shdocvw/tests/intshcut.c
index c046601..360876e 100644
--- a/dlls/shdocvw/tests/intshcut.c
+++ b/dlls/shdocvw/tests/intshcut.c
@@ -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]);




More information about the wine-cvs mailing list