Module: wine Branch: master Commit: d32ee8e4a01ef2d75377763713fa465da8d8ea8b URL: http://source.winehq.org/git/wine.git/?a=commit;h=d32ee8e4a01ef2d75377763713...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Aug 13 11:04:18 2012 +0200
mshtml: Added VBScript in HTML tests.
---
dlls/mshtml/tests/rsrc.rc | 3 +++ dlls/mshtml/tests/script.c | 19 +++++++++++++++---- dlls/mshtml/tests/vbtest.html | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/tests/rsrc.rc b/dlls/mshtml/tests/rsrc.rc index d6c0ffd..fb74c45 100644 --- a/dlls/mshtml/tests/rsrc.rc +++ b/dlls/mshtml/tests/rsrc.rc @@ -21,3 +21,6 @@ exectest.html HTML "exectest.html"
/* @makedep: jstest.html */ jstest.html HTML "jstest.html" + +/* @makedep: vbtest.html */ +vbtest.html HTML "vbtest.html" diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c index 0457029..dcad5f7 100644 --- a/dlls/mshtml/tests/script.c +++ b/dlls/mshtml/tests/script.c @@ -594,7 +594,9 @@ static HRESULT WINAPI externalDisp_InvokeEx(IDispatchEx *iface, DISPID id, LCID VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) { switch(id) { - case DISPID_EXTERNAL_OK: + case DISPID_EXTERNAL_OK: { + VARIANT *b, *m; + ok(wFlags == INVOKE_FUNC || wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags); ok(pdp != NULL, "pdp == NULL\n"); ok(pdp->rgvarg != NULL, "rgvarg == NULL\n"); @@ -603,11 +605,19 @@ static HRESULT WINAPI externalDisp_InvokeEx(IDispatchEx *iface, DISPID id, LCID ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); ok(pei != NULL, "pei == NULL\n");
- ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg)); - ok(V_VT(pdp->rgvarg+1) == VT_BOOL, "V_VT(psp->rgvargs+1) = %d\n", V_VT(pdp->rgvarg)); - ok(V_BOOL(pdp->rgvarg+1), "%s\n", wine_dbgstr_w(V_BSTR(pdp->rgvarg))); + m = pdp->rgvarg; + if(V_VT(m) == (VT_BYREF|VT_VARIANT)) + m = V_BYREF(m); + ok(V_VT(m) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg)); + + b = pdp->rgvarg+1; + if(V_VT(b) == (VT_BYREF|VT_VARIANT)) + b = V_BYREF(b); + ok(V_VT(b) == VT_BOOL, "V_VT(b) = %d\n", V_VT(b));
+ ok(V_BOOL(b), "%s\n", wine_dbgstr_w(V_BSTR(m))); return S_OK; + }
case DISPID_EXTERNAL_TRACE: ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags); @@ -2732,6 +2742,7 @@ static void run_js_tests(void) { run_js_script("jstest.html"); run_js_script("exectest.html"); + run_js_script("vbtest.html"); }
static BOOL init_registry(BOOL init) diff --git a/dlls/mshtml/tests/vbtest.html b/dlls/mshtml/tests/vbtest.html new file mode 100644 index 0000000..9addc93 --- /dev/null +++ b/dlls/mshtml/tests/vbtest.html @@ -0,0 +1,34 @@ +<html> +<head> +<script type="text/vbscript"> +Dim counter + +counter = 1 + +Sub ok(b,m) + Call external.ok(b,m) +End Sub +</script> +<script> +' Verifies that we're in VBScript although there is no type specified +If true then counter = counter+1 +</script> +<script type="text/javascript"> +// We're in javascript +</script> +<script type="text/vbscript"> +' And back to VBScript +If true then counter = counter+1 + +Sub runTest() + Call ok(counter = 3, "counter = " & counter) + Call external.reportSuccess() +End Sub +</script> +</script> +<body> +<script> +runTest() +</script> +</body> +</html>