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
1c6649d4
Commit
1c6649d4
authored
Feb 03, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Add SetScriptState(SCRIPTSTATE_CLOSED) implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8def4dfa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
1 deletion
+75
-1
vbscript.c
dlls/vbscript/tests/vbscript.c
+71
-0
vbscript.c
dlls/vbscript/vbscript.c
+4
-1
No files found.
dlls/vbscript/tests/vbscript.c
View file @
1c6649d4
...
...
@@ -1520,10 +1520,81 @@ static void test_vbscript_uninitializing(void)
hres
=
IActiveScriptParse_InitNew
(
parse
);
ok
(
hres
==
E_UNEXPECTED
,
"InitNew failed: %08x
\n
"
,
hres
);
/* initialize again and use SetScriptState(SCRIPTSTATE_CLOSED) to uninitialize it */
SET_EXPECT
(
GetLCID
);
SET_EXPECT
(
OnStateChange_INITIALIZED
);
hres
=
IActiveScript_SetScriptSite
(
script
,
&
ActiveScriptSite
);
ok
(
hres
==
S_OK
,
"SetScriptSite failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
GetLCID
);
CHECK_CALLED
(
OnStateChange_INITIALIZED
);
SET_EXPECT
(
OnStateChange_CONNECTED
);
hres
=
IActiveScript_SetScriptState
(
script
,
SCRIPTSTATE_CONNECTED
);
ok
(
hres
==
S_OK
,
"SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
OnStateChange_CONNECTED
);
SET_EXPECT
(
OnStateChange_DISCONNECTED
);
SET_EXPECT
(
OnStateChange_INITIALIZED
);
SET_EXPECT
(
OnStateChange_CLOSED
);
hres
=
IActiveScript_SetScriptState
(
script
,
SCRIPTSTATE_CLOSED
);
ok
(
hres
==
S_OK
,
"SetScriptState(SCRIPTSTATE_CLOSED) failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
OnStateChange_DISCONNECTED
);
CHECK_CALLED
(
OnStateChange_INITIALIZED
);
CHECK_CALLED
(
OnStateChange_CLOSED
);
test_state
(
script
,
SCRIPTSTATE_CLOSED
);
hres
=
IActiveScript_SetScriptState
(
script
,
SCRIPTSTATE_CLOSED
);
ok
(
hres
==
S_OK
,
"SetScriptState(SCRIPTSTATE_CLOSED) failed: %08x
\n
"
,
hres
);
hres
=
IActiveScript_SetScriptState
(
script
,
SCRIPTSTATE_INITIALIZED
);
ok
(
hres
==
E_UNEXPECTED
,
"SetScriptState(SCRIPTSTATE_INITIALIZED) failed: %08x
\n
"
,
hres
);
hres
=
IActiveScript_Close
(
script
);
ok
(
hres
==
S_OK
,
"Close failed: %08x
\n
"
,
hres
);
SET_EXPECT
(
GetLCID
);
SET_EXPECT
(
OnStateChange_INITIALIZED
);
hres
=
IActiveScript_SetScriptSite
(
script
,
&
ActiveScriptSite
);
ok
(
hres
==
S_OK
,
"SetScriptSite failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
GetLCID
);
CHECK_CALLED
(
OnStateChange_INITIALIZED
);
SET_EXPECT
(
OnStateChange_CONNECTED
);
hres
=
IActiveScript_SetScriptState
(
script
,
SCRIPTSTATE_CONNECTED
);
ok
(
hres
==
S_OK
,
"SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
OnStateChange_CONNECTED
);
SET_EXPECT
(
OnStateChange_DISCONNECTED
);
SET_EXPECT
(
OnStateChange_INITIALIZED
);
SET_EXPECT
(
OnStateChange_CLOSED
);
hres
=
IActiveScript_Close
(
script
);
ok
(
hres
==
S_OK
,
"Close failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
OnStateChange_DISCONNECTED
);
CHECK_CALLED
(
OnStateChange_INITIALIZED
);
CHECK_CALLED
(
OnStateChange_CLOSED
);
test_state
(
script
,
SCRIPTSTATE_CLOSED
);
hres
=
IActiveScript_SetScriptState
(
script
,
SCRIPTSTATE_CLOSED
);
ok
(
hres
==
S_OK
,
"SetScriptState(SCRIPTSTATE_CLOSED) failed: %08x
\n
"
,
hres
);
hres
=
IActiveScript_SetScriptState
(
script
,
SCRIPTSTATE_INITIALIZED
);
ok
(
hres
==
E_UNEXPECTED
,
"SetScriptState(SCRIPTSTATE_INITIALIZED) failed: %08x
\n
"
,
hres
);
IActiveScriptParse_Release
(
parse
);
ref
=
IActiveScript_Release
(
script
);
ok
(
!
ref
,
"ref = %d
\n
"
,
ref
);
script
=
create_vbscript
();
hres
=
IActiveScript_SetScriptState
(
script
,
SCRIPTSTATE_CLOSED
);
ok
(
hres
==
E_UNEXPECTED
,
"SetScriptState(SCRIPTSTATE_CLOSED) failed: %08x
\n
"
,
hres
);
ref
=
IActiveScript_Release
(
script
);
ok
(
!
ref
,
"ref = %d
\n
"
,
ref
);
}
static
void
test_vbscript_release
(
void
)
...
...
dlls/vbscript/vbscript.c
View file @
1c6649d4
...
...
@@ -559,7 +559,7 @@ static HRESULT WINAPI VBScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE
return
S_OK
;
}
if
(
!
This
->
is_initialized
||
!
This
->
ctx
->
site
)
if
(
!
This
->
is_initialized
||
(
!
This
->
ctx
->
site
&&
ss
!=
SCRIPTSTATE_CLOSED
)
)
return
E_UNEXPECTED
;
switch
(
ss
)
{
...
...
@@ -573,6 +573,9 @@ static HRESULT WINAPI VBScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE
case
SCRIPTSTATE_INITIALIZED
:
decrease_state
(
This
,
SCRIPTSTATE_INITIALIZED
);
return
S_OK
;
case
SCRIPTSTATE_CLOSED
:
decrease_state
(
This
,
SCRIPTSTATE_CLOSED
);
return
S_OK
;
case
SCRIPTSTATE_DISCONNECTED
:
FIXME
(
"unimplemented SCRIPTSTATE_DISCONNECTED
\n
"
);
return
S_OK
;
...
...
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