Andrew Nguyen : msi/tests: Run the automation tests in silent mode to avoid a dialog.

Alexandre Julliard julliard at winehq.org
Fri Jul 9 09:46:26 CDT 2010


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

Author: Andrew Nguyen <anguyen at codeweavers.com>
Date:   Fri Jul  9 04:08:38 2010 -0500

msi/tests: Run the automation tests in silent mode to avoid a dialog.

---

 dlls/msi/tests/automation.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c
index bad4882..35b660b 100644
--- a/dlls/msi/tests/automation.c
+++ b/dlls/msi/tests/automation.c
@@ -1081,6 +1081,20 @@ static HRESULT Installer_VersionGet(LPWSTR szVersion)
     return hr;
 }
 
+static HRESULT Installer_UILevelPut(int level)
+{
+    VARIANT varresult;
+    VARIANTARG vararg;
+    DISPID dispid = DISPID_PROPERTYPUT;
+    DISPPARAMS dispparams = {&vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
+
+    VariantInit(&vararg);
+    V_VT(&vararg) = VT_I4;
+    V_I4(&vararg) = level;
+
+    return invoke(pInstaller, "UILevel", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY);
+}
+
 static HRESULT Session_Installer(IDispatch *pSession, IDispatch **pInst)
 {
     VARIANT varresult;
@@ -2383,6 +2397,10 @@ static void test_Installer_InstallProduct(void)
 
     create_test_files();
 
+    /* Avoid an interactive dialog in case of insufficient privileges. */
+    hr = Installer_UILevelPut(INSTALLUILEVEL_NONE);
+    ok(hr == S_OK, "Expected UILevel propery put invoke to return S_OK, got 0x%08x\n", hr);
+
     /* Installer::InstallProduct */
     hr = Installer_InstallProduct(szMsifile, NULL);
     if (hr == DISP_E_EXCEPTION)




More information about the wine-cvs mailing list