Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
142d0f30
Commit
142d0f30
authored
Jul 30, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 30, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript/tests: Use proper helpers for iface calls.
parent
d0b8c6bc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
125 additions
and
53 deletions
+125
-53
activex.c
dlls/jscript/tests/activex.c
+46
-22
caller.c
dlls/jscript/tests/caller.c
+23
-7
jscript.c
dlls/jscript/tests/jscript.c
+25
-9
run.c
dlls/jscript/tests/run.c
+31
-15
No files found.
dlls/jscript/tests/activex.c
View file @
142d0f30
...
...
@@ -30,6 +30,30 @@
#include "wine/test.h"
#ifdef _WIN64
#define IActiveScriptParse_QueryInterface IActiveScriptParse64_QueryInterface
#define IActiveScriptParse_Release IActiveScriptParse64_Release
#define IActiveScriptParse_InitNew IActiveScriptParse64_InitNew
#define IActiveScriptParse_ParseScriptText IActiveScriptParse64_ParseScriptText
#define IActiveScriptParseProcedure2_Release \
IActiveScriptParseProcedure2_64_Release
#define IActiveScriptParseProcedure2_ParseProcedureText \
IActiveScriptParseProcedure2_64_ParseProcedureText
#else
#define IActiveScriptParse_QueryInterface IActiveScriptParse32_QueryInterface
#define IActiveScriptParse_Release IActiveScriptParse32_Release
#define IActiveScriptParse_InitNew IActiveScriptParse32_InitNew
#define IActiveScriptParse_ParseScriptText IActiveScriptParse32_ParseScriptText
#define IActiveScriptParseProcedure2_Release \
IActiveScriptParseProcedure2_32_Release
#define IActiveScriptParseProcedure2_ParseProcedureText \
IActiveScriptParseProcedure2_32_ParseProcedureText
#endif
static
const
CLSID
CLSID_JScript
=
{
0xf414c260
,
0x6ac0
,
0x11cf
,{
0xb6
,
0xd1
,
0x00
,
0xaa
,
0x00
,
0xbb
,
0xbb
,
0x58
}};
...
...
@@ -696,7 +720,7 @@ static void _parse_script_a(unsigned line, IActiveScriptParse *parser, const cha
HRESULT
hres
;
str
=
a2bstr
(
script
);
hres
=
IActiveScriptParse
64
_ParseScriptText
(
parser
,
str
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
hres
=
IActiveScriptParse_ParseScriptText
(
parser
,
str
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
SysFreeString
(
str
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"ParseScriptText failed: %08x
\n
"
,
hres
);
}
...
...
@@ -731,7 +755,7 @@ static IActiveScriptParse *create_script(BOOL skip_tests, BOOL use_sec_mgr)
hres
=
IActiveScript_QueryInterface
(
script
,
&
IID_IActiveScriptParse
,
(
void
**
)
&
parser
);
ok
(
hres
==
S_OK
,
"Could not get IActiveScriptParse: %08x
\n
"
,
hres
);
hres
=
IActiveScriptParse
64
_InitNew
(
parser
);
hres
=
IActiveScriptParse_InitNew
(
parser
);
ok
(
hres
==
S_OK
,
"InitNew failed: %08x
\n
"
,
hres
);
hres
=
IActiveScript_SetScriptSite
(
script
,
&
ActiveScriptSite
);
...
...
@@ -771,18 +795,18 @@ static IDispatchEx *parse_procedure_a(IActiveScriptParse *parser, const char *sr
BSTR
str
;
HRESULT
hres
;
hres
=
I
Unknown
_QueryInterface
(
parser
,
&
IID_IActiveScriptParseProcedure2
,
(
void
**
)
&
parse_proc
);
hres
=
I
ActiveScriptParse
_QueryInterface
(
parser
,
&
IID_IActiveScriptParseProcedure2
,
(
void
**
)
&
parse_proc
);
ok
(
hres
==
S_OK
,
"Could not get IActiveScriptParseProcedure2: %08x
\n
"
,
hres
);
str
=
a2bstr
(
src
);
hres
=
IActiveScriptParseProcedure2_
64_
ParseProcedureText
(
parse_proc
,
str
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
&
disp
);
hres
=
IActiveScriptParseProcedure2_ParseProcedureText
(
parse_proc
,
str
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
&
disp
);
SysFreeString
(
str
);
I
Unknown
_Release
(
parse_proc
);
I
ActiveScriptParseProcedure2
_Release
(
parse_proc
);
ok
(
hres
==
S_OK
,
"ParseProcedureText failed: %08x
\n
"
,
hres
);
ok
(
disp
!=
NULL
,
"disp == NULL
\n
"
);
hres
=
IDispatch_QueryInterface
(
disp
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
IDispatch_Release
(
disp
ex
);
IDispatch_Release
(
disp
);
ok
(
hres
==
S_OK
,
"Could not get IDispatchEx iface: %08x
\n
"
,
hres
);
return
dispex
;
...
...
@@ -848,7 +872,7 @@ static void test_ActiveXObject(void)
CHECK_CALLED
(
reportSuccess
);
IDispatchEx_Release
(
proc
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
parser
=
create_script
(
FALSE
,
TRUE
);
proc
=
parse_procedure_a
(
parser
,
"(new ActiveXObject('Wine.Test')).reportSuccess();"
);
...
...
@@ -870,7 +894,7 @@ static void test_ActiveXObject(void)
parse_script_a
(
parser
,
"testException(function() { new ActiveXObject('Wine.TestABC'); }, 'Error', -2146827859);"
);
IDispatchEx_Release
(
proc
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
parser
=
create_script
(
FALSE
,
TRUE
);
QS_SecMgr_hres
=
E_NOINTERFACE
;
...
...
@@ -879,7 +903,7 @@ static void test_ActiveXObject(void)
parse_script_a
(
parser
,
"testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);"
);
CHECK_CALLED
(
Host_QS_SecMgr
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
parser
=
create_script
(
FALSE
,
TRUE
);
ProcessUrlAction_hres
=
E_FAIL
;
...
...
@@ -890,7 +914,7 @@ static void test_ActiveXObject(void)
CHECK_CALLED
(
Host_QS_SecMgr
);
CHECK_CALLED
(
ProcessUrlAction
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
parser
=
create_script
(
FALSE
,
TRUE
);
ProcessUrlAction_policy
=
URLPOLICY_DISALLOW
;
...
...
@@ -901,7 +925,7 @@ static void test_ActiveXObject(void)
CHECK_CALLED
(
Host_QS_SecMgr
);
CHECK_CALLED
(
ProcessUrlAction
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
parser
=
create_script
(
FALSE
,
TRUE
);
CreateInstance_hres
=
E_FAIL
;
...
...
@@ -914,7 +938,7 @@ static void test_ActiveXObject(void)
CHECK_CALLED
(
ProcessUrlAction
);
CHECK_CALLED
(
CreateInstance
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
parser
=
create_script
(
FALSE
,
TRUE
);
QueryCustomPolicy_hres
=
E_FAIL
;
...
...
@@ -929,7 +953,7 @@ static void test_ActiveXObject(void)
CHECK_CALLED
(
CreateInstance
);
CHECK_CALLED
(
QueryCustomPolicy
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
parser
=
create_script
(
FALSE
,
TRUE
);
QueryCustomPolicy_psize
=
6
;
...
...
@@ -948,7 +972,7 @@ static void test_ActiveXObject(void)
CHECK_CALLED
(
QI_IObjectWithSite
);
CHECK_CALLED
(
reportSuccess
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
parser
=
create_script
(
FALSE
,
TRUE
);
QueryCustomPolicy_policy
=
URLPOLICY_DISALLOW
;
...
...
@@ -984,7 +1008,7 @@ static void test_ActiveXObject(void)
CHECK_CALLED
(
CreateInstance
);
CHECK_CALLED
(
QueryCustomPolicy
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
parser
=
create_script
(
FALSE
,
FALSE
);
...
...
@@ -996,7 +1020,7 @@ static void test_ActiveXObject(void)
CHECK_CALLED
(
QI_IObjectWithSite
);
CHECK_CALLED
(
reportSuccess
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
parser
=
create_script
(
FALSE
,
TRUE
);
object_with_site
=
&
ObjectWithSite
;
...
...
@@ -1030,7 +1054,7 @@ static void test_ActiveXObject(void)
CHECK_CALLED
(
QI_IObjectWithSite
);
CHECK_CALLED
(
SetSite
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
/* No IServiceProvider Interface */
parser
=
create_script
(
FALSE
,
FALSE
);
...
...
@@ -1047,7 +1071,7 @@ static void test_ActiveXObject(void)
CHECK_CALLED
(
reportSuccess
);
CHECK_CALLED
(
SetSite
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
parser
=
create_script
(
FALSE
,
TRUE
);
object_with_site
=
&
ObjectWithSite
;
...
...
@@ -1055,7 +1079,7 @@ static void test_ActiveXObject(void)
parse_script_a
(
parser
,
"testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);"
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
}
static
BOOL
init_key
(
const
char
*
key_name
,
const
char
*
def_value
,
BOOL
init
)
...
...
@@ -1114,12 +1138,12 @@ static BOOL check_jscript(void)
return
FALSE
;
str
=
a2bstr
(
"if(!('localeCompare' in String.prototype)) throw 1;"
);
hres
=
IActiveScriptParse
64
_ParseScriptText
(
parser
,
str
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
hres
=
IActiveScriptParse_ParseScriptText
(
parser
,
str
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
SysFreeString
(
str
);
if
(
hres
==
S_OK
)
hres
=
I
Unknown
_QueryInterface
(
parser
,
&
IID_IActiveScriptProperty
,
(
void
**
)
&
script_prop
);
I
Unknown
_Release
(
parser
);
hres
=
I
ActiveScriptParse
_QueryInterface
(
parser
,
&
IID_IActiveScriptProperty
,
(
void
**
)
&
script_prop
);
I
ActiveScriptParse
_Release
(
parser
);
if
(
hres
==
S_OK
)
IActiveScriptProperty_Release
(
script_prop
);
...
...
dlls/jscript/tests/caller.c
View file @
142d0f30
...
...
@@ -28,6 +28,22 @@
#include "wine/test.h"
#ifdef _WIN64
#define IActiveScriptParse_QueryInterface IActiveScriptParse64_QueryInterface
#define IActiveScriptParse_Release IActiveScriptParse64_Release
#define IActiveScriptParse_InitNew IActiveScriptParse64_InitNew
#define IActiveScriptParse_ParseScriptText IActiveScriptParse64_ParseScriptText
#else
#define IActiveScriptParse_QueryInterface IActiveScriptParse32_QueryInterface
#define IActiveScriptParse_Release IActiveScriptParse32_Release
#define IActiveScriptParse_InitNew IActiveScriptParse32_InitNew
#define IActiveScriptParse_ParseScriptText IActiveScriptParse32_ParseScriptText
#endif
static
const
CLSID
CLSID_JScript
=
{
0xf414c260
,
0x6ac0
,
0x11cf
,{
0xb6
,
0xd1
,
0x00
,
0xaa
,
0x00
,
0xbb
,
0xbb
,
0x58
}};
...
...
@@ -464,7 +480,7 @@ static void _parse_script_a(unsigned line, IActiveScriptParse *parser, const cha
HRESULT
hres
;
str
=
a2bstr
(
script
);
hres
=
IActiveScriptParse
64
_ParseScriptText
(
parser
,
str
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
hres
=
IActiveScriptParse_ParseScriptText
(
parser
,
str
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
SysFreeString
(
str
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"ParseScriptText failed: %08x
\n
"
,
hres
);
}
...
...
@@ -483,7 +499,7 @@ static IActiveScriptParse *create_script(void)
hres
=
IActiveScript_QueryInterface
(
script
,
&
IID_IActiveScriptParse
,
(
void
**
)
&
parser
);
ok
(
hres
==
S_OK
,
"Could not get IActiveScriptParse: %08x
\n
"
,
hres
);
hres
=
IActiveScriptParse
64
_InitNew
(
parser
);
hres
=
IActiveScriptParse_InitNew
(
parser
);
ok
(
hres
==
S_OK
,
"InitNew failed: %08x
\n
"
,
hres
);
hres
=
IActiveScript_SetScriptSite
(
script
,
&
ActiveScriptSite
);
...
...
@@ -508,7 +524,7 @@ static void run_scripts(void)
parser
=
create_script
();
hres
=
IActiveScriptParse
64
_QueryInterface
(
parser
,
&
IID_IVariantChangeType
,
(
void
**
)
&
script_change_type
);
hres
=
IActiveScriptParse_QueryInterface
(
parser
,
&
IID_IVariantChangeType
,
(
void
**
)
&
script_change_type
);
ok
(
hres
==
S_OK
,
"Could not get IVariantChangeType iface: %08x
\n
"
,
hres
);
SET_EXPECT
(
testArgConv
);
...
...
@@ -524,7 +540,7 @@ static void run_scripts(void)
IDispatch_Release
(
stored_obj
);
IVariantChangeType_Release
(
script_change_type
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
}
static
BOOL
check_jscript
(
void
)
...
...
@@ -539,12 +555,12 @@ static BOOL check_jscript(void)
return
FALSE
;
str
=
a2bstr
(
"if(!('localeCompare' in String.prototype)) throw 1;"
);
hres
=
IActiveScriptParse
64
_ParseScriptText
(
parser
,
str
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
hres
=
IActiveScriptParse_ParseScriptText
(
parser
,
str
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
SysFreeString
(
str
);
if
(
hres
==
S_OK
)
hres
=
I
Unknown
_QueryInterface
(
parser
,
&
IID_IActiveScriptProperty
,
(
void
**
)
&
script_prop
);
I
Unknown
_Release
(
parser
);
hres
=
I
ActiveScriptParse
_QueryInterface
(
parser
,
&
IID_IActiveScriptProperty
,
(
void
**
)
&
script_prop
);
I
ActiveScriptParse
_Release
(
parser
);
if
(
hres
==
S_OK
)
IActiveScriptProperty_Release
(
script_prop
);
...
...
dlls/jscript/tests/jscript.c
View file @
142d0f30
...
...
@@ -27,6 +27,22 @@
#include "wine/test.h"
#ifdef _WIN64
#define IActiveScriptParse_QueryInterface IActiveScriptParse64_QueryInterface
#define IActiveScriptParse_Release IActiveScriptParse64_Release
#define IActiveScriptParse_InitNew IActiveScriptParse64_InitNew
#define IActiveScriptParse_ParseScriptText IActiveScriptParse64_ParseScriptText
#else
#define IActiveScriptParse_QueryInterface IActiveScriptParse32_QueryInterface
#define IActiveScriptParse_Release IActiveScriptParse32_Release
#define IActiveScriptParse_InitNew IActiveScriptParse32_InitNew
#define IActiveScriptParse_ParseScriptText IActiveScriptParse32_ParseScriptText
#endif
DEFINE_GUID
(
GUID_NULL
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
static
const
CLSID
CLSID_JScript
=
...
...
@@ -437,10 +453,10 @@ static void test_jscript(void)
test_safety
((
IUnknown
*
)
script
);
test_invoke_versioning
(
script
);
hres
=
IActiveScriptParse
64
_InitNew
(
parse
);
hres
=
IActiveScriptParse_InitNew
(
parse
);
ok
(
hres
==
S_OK
,
"InitNew failed: %08x
\n
"
,
hres
);
hres
=
IActiveScriptParse
64
_InitNew
(
parse
);
hres
=
IActiveScriptParse_InitNew
(
parse
);
ok
(
hres
==
E_UNEXPECTED
,
"InitNew failed: %08x, expected E_UNEXPECTED
\n
"
,
hres
);
hres
=
IActiveScript_SetScriptSite
(
script
,
NULL
);
...
...
@@ -481,7 +497,7 @@ static void test_jscript(void)
test_script_dispatch
(
dispex
);
IDispatchEx_Release
(
dispex
);
I
Unknown
_Release
(
parse
);
I
ActiveScriptParse
_Release
(
parse
);
ref
=
IActiveScript_Release
(
script
);
ok
(
!
ref
,
"ref = %d
\n
"
,
ref
);
...
...
@@ -509,11 +525,11 @@ static void test_jscript2(void)
test_state
(
script
,
SCRIPTSTATE_UNINITIALIZED
);
SET_EXPECT
(
OnStateChange_INITIALIZED
);
hres
=
IActiveScriptParse
64
_InitNew
(
parse
);
hres
=
IActiveScriptParse_InitNew
(
parse
);
ok
(
hres
==
S_OK
,
"InitNew failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
OnStateChange_INITIALIZED
);
hres
=
IActiveScriptParse
64
_InitNew
(
parse
);
hres
=
IActiveScriptParse_InitNew
(
parse
);
ok
(
hres
==
E_UNEXPECTED
,
"InitNew failed: %08x, expected E_UNEXPECTED
\n
"
,
hres
);
SET_EXPECT
(
OnStateChange_CONNECTED
);
...
...
@@ -535,7 +551,7 @@ static void test_jscript2(void)
test_state
(
script
,
SCRIPTSTATE_CLOSED
);
test_no_script_dispatch
(
script
);
I
Unknown
_Release
(
parse
);
I
ActiveScriptParse
_Release
(
parse
);
ref
=
IActiveScript_Release
(
script
);
ok
(
!
ref
,
"ref = %d
\n
"
,
ref
);
...
...
@@ -559,7 +575,7 @@ static void test_jscript_uninitializing(void)
test_state
(
script
,
SCRIPTSTATE_UNINITIALIZED
);
hres
=
IActiveScriptParse
64
_InitNew
(
parse
);
hres
=
IActiveScriptParse_InitNew
(
parse
);
ok
(
hres
==
S_OK
,
"InitNew failed: %08x
\n
"
,
hres
);
SET_EXPECT
(
GetLCID
);
...
...
@@ -571,7 +587,7 @@ static void test_jscript_uninitializing(void)
test_state
(
script
,
SCRIPTSTATE_INITIALIZED
);
hres
=
IActiveScriptParse
64
_ParseScriptText
(
parse
,
script_textW
,
NULL
,
NULL
,
NULL
,
0
,
1
,
0x42
,
NULL
,
NULL
);
hres
=
IActiveScriptParse_ParseScriptText
(
parse
,
script_textW
,
NULL
,
NULL
,
NULL
,
0
,
1
,
0x42
,
NULL
,
NULL
);
ok
(
hres
==
S_OK
,
"ParseScriptText failed: %08x
\n
"
,
hres
);
hres
=
IActiveScript_SetScriptSite
(
script
,
&
ActiveScriptSite
);
...
...
@@ -630,7 +646,7 @@ static void test_jscript_uninitializing(void)
test_state
(
script
,
SCRIPTSTATE_CLOSED
);
I
Unknown
_Release
(
parse
);
I
ActiveScriptParse
_Release
(
parse
);
ref
=
IActiveScript_Release
(
script
);
ok
(
!
ref
,
"ref = %d
\n
"
,
ref
);
...
...
dlls/jscript/tests/run.c
View file @
142d0f30
...
...
@@ -27,6 +27,22 @@
#include "wine/test.h"
#ifdef _WIN64
#define IActiveScriptParse_QueryInterface IActiveScriptParse64_QueryInterface
#define IActiveScriptParse_Release IActiveScriptParse64_Release
#define IActiveScriptParse_InitNew IActiveScriptParse64_InitNew
#define IActiveScriptParse_ParseScriptText IActiveScriptParse64_ParseScriptText
#else
#define IActiveScriptParse_QueryInterface IActiveScriptParse32_QueryInterface
#define IActiveScriptParse_Release IActiveScriptParse32_Release
#define IActiveScriptParse_InitNew IActiveScriptParse32_InitNew
#define IActiveScriptParse_ParseScriptText IActiveScriptParse32_ParseScriptText
#endif
static
const
CLSID
CLSID_JScript
=
{
0xf414c260
,
0x6ac0
,
0x11cf
,{
0xb6
,
0xd1
,
0x00
,
0xaa
,
0x00
,
0xbb
,
0xbb
,
0x58
}};
static
const
CLSID
CLSID_JScriptEncode
=
...
...
@@ -1108,7 +1124,7 @@ static HRESULT WINAPI ActiveScriptSite_OnScriptError_CheckError(IActiveScriptSit
ok
(
pscripterror
!=
NULL
,
"ActiveScriptSite_OnScriptError -- expected pscripterror to be set, got NULL
\n
"
);
script_error
=
pscripterror
;
I
Unknown
_AddRef
(
script_error
);
I
ActiveScriptError
_AddRef
(
script_error
);
CHECK_EXPECT
(
ActiveScriptSite_OnScriptError
);
...
...
@@ -1186,7 +1202,7 @@ static HRESULT parse_script(DWORD flags, BSTR script_str)
return
hres
;
}
hres
=
IActiveScriptParse
64
_InitNew
(
parser
);
hres
=
IActiveScriptParse_InitNew
(
parser
);
ok
(
hres
==
S_OK
,
"InitNew failed: %08x
\n
"
,
hres
);
hres
=
IActiveScript_SetScriptSite
(
engine
,
&
ActiveScriptSite
);
...
...
@@ -1204,11 +1220,11 @@ static HRESULT parse_script(DWORD flags, BSTR script_str)
ok
(
script_disp
!=
NULL
,
"script_disp == NULL
\n
"
);
ok
(
script_disp
!=
(
IDispatch
*
)
&
Global
,
"script_disp == Global
\n
"
);
hres
=
IActiveScriptParse
64
_ParseScriptText
(
parser
,
script_str
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
hres
=
IActiveScriptParse_ParseScriptText
(
parser
,
script_str
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
IDispatch_Release
(
script_disp
);
IActiveScript_Release
(
engine
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
return
hres
;
}
...
...
@@ -1232,7 +1248,7 @@ static HRESULT parse_htmlscript(BSTR script_str)
return
E_FAIL
;
}
hres
=
IActiveScriptParse
64
_InitNew
(
parser
);
hres
=
IActiveScriptParse_InitNew
(
parser
);
ok
(
hres
==
S_OK
,
"InitNew failed: %08x
\n
"
,
hres
);
hres
=
IActiveScript_SetScriptSite
(
engine
,
&
ActiveScriptSite
);
...
...
@@ -1245,10 +1261,10 @@ static HRESULT parse_htmlscript(BSTR script_str)
hres
=
IActiveScript_SetScriptState
(
engine
,
SCRIPTSTATE_STARTED
);
ok
(
hres
==
S_OK
,
"SetScriptState(SCRIPTSTATE_STARTED) failed: %08x
\n
"
,
hres
);
hres
=
IActiveScriptParse
64
_ParseScriptText
(
parser
,
script_str
,
NULL
,
NULL
,
tmp
,
0
,
0
,
0
,
NULL
,
NULL
);
hres
=
IActiveScriptParse_ParseScriptText
(
parser
,
script_str
,
NULL
,
NULL
,
tmp
,
0
,
0
,
0
,
NULL
,
NULL
);
IActiveScript_Release
(
engine
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
SysFreeString
(
tmp
);
return
hres
;
...
...
@@ -1360,7 +1376,7 @@ static void parse_script_with_error(DWORD flags, BSTR script_str, SCODE errorcod
return
;
}
hres
=
IActiveScriptParse
64
_InitNew
(
parser
);
hres
=
IActiveScriptParse_InitNew
(
parser
);
ok
(
hres
==
S_OK
,
"InitNew failed: %08x
\n
"
,
hres
);
hres
=
IActiveScript_SetScriptSite
(
engine
,
&
ActiveScriptSite_CheckError
);
...
...
@@ -1380,7 +1396,7 @@ static void parse_script_with_error(DWORD flags, BSTR script_str, SCODE errorcod
script_error
=
NULL
;
SET_EXPECT
(
ActiveScriptSite_OnScriptError
);
hres
=
IActiveScriptParse
64
_ParseScriptText
(
parser
,
script_str
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
hres
=
IActiveScriptParse_ParseScriptText
(
parser
,
script_str
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
todo_wine
ok
(
hres
==
0x80020101
,
"parse_script_with_error should have returned 0x80020101, got: 0x%08x
\n
"
,
hres
);
todo_wine
CHECK_CALLED
(
ActiveScriptSite_OnScriptError
);
...
...
@@ -1388,12 +1404,12 @@ static void parse_script_with_error(DWORD flags, BSTR script_str, SCODE errorcod
{
test_IActiveScriptError
(
script_error
,
errorcode
,
line
,
pos
,
script_source
,
description
,
line_text
);
I
Unknown
_Release
(
script_error
);
I
ActiveScriptError
_Release
(
script_error
);
}
IDispatch_Release
(
script_disp
);
IActiveScript_Release
(
engine
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
}
static
void
parse_script_af
(
DWORD
flags
,
const
char
*
src
)
...
...
@@ -1544,7 +1560,7 @@ static void test_isvisible(BOOL global_members)
return
;
}
hres
=
IActiveScriptParse
64
_InitNew
(
parser
);
hres
=
IActiveScriptParse_InitNew
(
parser
);
ok
(
hres
==
S_OK
,
"InitNew failed: %08x
\n
"
,
hres
);
hres
=
IActiveScript_SetScriptSite
(
engine
,
&
ActiveScriptSite
);
...
...
@@ -1564,16 +1580,16 @@ static void test_isvisible(BOOL global_members)
if
(
!
global_members
)
SET_EXPECT
(
GetItemInfo_testVal
);
hres
=
IActiveScriptParse
64
_ParseScriptText
(
parser
,
script_textW
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
hres
=
IActiveScriptParse_ParseScriptText
(
parser
,
script_textW
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
ok
(
hres
==
S_OK
,
"ParseScriptText failed: %08x
\n
"
,
hres
);
if
(
!
global_members
)
CHECK_CALLED
(
GetItemInfo_testVal
);
hres
=
IActiveScriptParse
64
_ParseScriptText
(
parser
,
script_textW
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
hres
=
IActiveScriptParse_ParseScriptText
(
parser
,
script_textW
,
NULL
,
NULL
,
NULL
,
0
,
0
,
0
,
NULL
,
NULL
);
ok
(
hres
==
S_OK
,
"ParseScriptText failed: %08x
\n
"
,
hres
);
IActiveScript_Release
(
engine
);
I
Unknown
_Release
(
parser
);
I
ActiveScriptParse
_Release
(
parser
);
}
static
BOOL
run_tests
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment