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
73658a8b
Commit
73658a8b
authored
Nov 05, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added SCRIPTSTATE_CONNECTED implementation.
parent
89327655
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
jscript.c
dlls/jscript/jscript.c
+9
-2
jscript.c
dlls/jscript/tests/jscript.c
+19
-0
No files found.
dlls/jscript/jscript.c
View file @
73658a8b
...
...
@@ -264,6 +264,7 @@ static HRESULT WINAPI JScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE s
switch
(
ss
)
{
case
SCRIPTSTATE_STARTED
:
case
SCRIPTSTATE_CONNECTED
:
/* FIXME */
if
(
This
->
ctx
->
state
==
SCRIPTSTATE_CLOSED
)
return
E_UNEXPECTED
;
...
...
@@ -308,9 +309,15 @@ static HRESULT WINAPI JScript_Close(IActiveScript *iface)
if
(
This
->
thread_id
!=
GetCurrentThreadId
())
return
E_UNEXPECTED
;
clear_script_queue
(
This
);
if
(
This
->
ctx
)
{
if
(
This
->
ctx
->
state
==
SCRIPTSTATE_CONNECTED
)
change_state
(
This
,
SCRIPTSTATE_DISCONNECTED
);
clear_script_queue
(
This
);
if
(
This
->
ctx
->
state
==
SCRIPTSTATE_DISCONNECTED
)
change_state
(
This
,
SCRIPTSTATE_INITIALIZED
);
if
(
This
->
ctx
->
named_items
)
{
named_item_t
*
iter
,
*
iter2
;
...
...
dlls/jscript/tests/jscript.c
View file @
73658a8b
...
...
@@ -61,6 +61,8 @@ static const CLSID CLSID_JScript =
DEFINE_EXPECT
(
GetLCID
);
DEFINE_EXPECT
(
OnStateChange_STARTED
);
DEFINE_EXPECT
(
OnStateChange_CONNECTED
);
DEFINE_EXPECT
(
OnStateChange_DISCONNECTED
);
DEFINE_EXPECT
(
OnStateChange_CLOSED
);
DEFINE_EXPECT
(
OnStateChange_INITIALIZED
);
DEFINE_EXPECT
(
OnEnterScript
);
...
...
@@ -134,6 +136,12 @@ static HRESULT WINAPI ActiveScriptSite_OnStateChange(IActiveScriptSite *iface, S
case
SCRIPTSTATE_STARTED
:
CHECK_EXPECT
(
OnStateChange_STARTED
);
return
S_OK
;
case
SCRIPTSTATE_CONNECTED
:
CHECK_EXPECT
(
OnStateChange_CONNECTED
);
return
S_OK
;
case
SCRIPTSTATE_DISCONNECTED
:
CHECK_EXPECT
(
OnStateChange_DISCONNECTED
);
return
S_OK
;
case
SCRIPTSTATE_CLOSED
:
CHECK_EXPECT
(
OnStateChange_CLOSED
);
return
S_OK
;
...
...
@@ -376,9 +384,20 @@ static void test_jscript2(void)
hres
=
IActiveScriptParse_InitNew
(
parse
);
ok
(
hres
==
E_UNEXPECTED
,
"InitNew failed: %08x, expected E_UNEXPECTED
\n
"
,
hres
);
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
);
test_state
(
script
,
SCRIPTSTATE_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
);
...
...
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