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
db21502d
Commit
db21502d
authored
Sep 01, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added IActiveScript::GetScriptState implementation.
parent
dfbb5b95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
jscript.c
dlls/jscript/jscript.c
+16
-2
jscript.c
dlls/jscript/tests/jscript.c
+16
-0
No files found.
dlls/jscript/jscript.c
View file @
db21502d
...
@@ -188,8 +188,22 @@ static HRESULT WINAPI JScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE s
...
@@ -188,8 +188,22 @@ static HRESULT WINAPI JScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE s
static
HRESULT
WINAPI
JScript_GetScriptState
(
IActiveScript
*
iface
,
SCRIPTSTATE
*
pssState
)
static
HRESULT
WINAPI
JScript_GetScriptState
(
IActiveScript
*
iface
,
SCRIPTSTATE
*
pssState
)
{
{
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
JScript
*
This
=
ACTSCRIPT_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pssState
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pssState
);
if
(
!
pssState
)
return
E_POINTER
;
if
(
!
This
->
thread_id
)
{
*
pssState
=
SCRIPTSTATE_UNINITIALIZED
;
return
S_OK
;
}
if
(
This
->
thread_id
!=
GetCurrentThreadId
())
return
E_UNEXPECTED
;
*
pssState
=
This
->
ctx
?
This
->
ctx
->
state
:
SCRIPTSTATE_UNINITIALIZED
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
JScript_Close
(
IActiveScript
*
iface
)
static
HRESULT
WINAPI
JScript_Close
(
IActiveScript
*
iface
)
...
...
dlls/jscript/tests/jscript.c
View file @
db21502d
...
@@ -66,6 +66,17 @@ DEFINE_EXPECT(OnStateChange_INITIALIZED);
...
@@ -66,6 +66,17 @@ DEFINE_EXPECT(OnStateChange_INITIALIZED);
DEFINE_EXPECT
(
OnEnterScript
);
DEFINE_EXPECT
(
OnEnterScript
);
DEFINE_EXPECT
(
OnLeaveScript
);
DEFINE_EXPECT
(
OnLeaveScript
);
#define test_state(s,ss) _test_state(__LINE__,s,ss)
static
void
_test_state
(
unsigned
line
,
IActiveScript
*
script
,
SCRIPTSTATE
exstate
)
{
SCRIPTSTATE
state
=
-
1
;
HRESULT
hres
;
hres
=
IActiveScript_GetScriptState
(
script
,
&
state
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"GetScriptState failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)
(
state
==
exstate
,
"state=%d, expected %d
\n
"
,
state
,
exstate
);
}
static
HRESULT
WINAPI
ActiveScriptSite_QueryInterface
(
IActiveScriptSite
*
iface
,
REFIID
riid
,
void
**
ppv
)
static
HRESULT
WINAPI
ActiveScriptSite_QueryInterface
(
IActiveScriptSite
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
{
*
ppv
=
NULL
;
*
ppv
=
NULL
;
...
@@ -277,6 +288,7 @@ static void test_jscript(void)
...
@@ -277,6 +288,7 @@ static void test_jscript(void)
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IActiveScriptParse
,
(
void
**
)
&
parse
);
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IActiveScriptParse
,
(
void
**
)
&
parse
);
ok
(
hres
==
S_OK
,
"Could not get IActiveScriptParse: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"Could not get IActiveScriptParse: %08x
\n
"
,
hres
);
test_state
(
script
,
SCRIPTSTATE_UNINITIALIZED
);
test_safety
(
unk
);
test_safety
(
unk
);
hres
=
IActiveScriptParse_InitNew
(
parse
);
hres
=
IActiveScriptParse_InitNew
(
parse
);
...
@@ -288,6 +300,7 @@ static void test_jscript(void)
...
@@ -288,6 +300,7 @@ static void test_jscript(void)
hres
=
IActiveScript_SetScriptSite
(
script
,
NULL
);
hres
=
IActiveScript_SetScriptSite
(
script
,
NULL
);
ok
(
hres
==
E_POINTER
,
"SetScriptSite failed: %08x, expected E_POINTER
\n
"
,
hres
);
ok
(
hres
==
E_POINTER
,
"SetScriptSite failed: %08x, expected E_POINTER
\n
"
,
hres
);
test_state
(
script
,
SCRIPTSTATE_UNINITIALIZED
);
test_script_dispatch
(
script
,
FALSE
);
test_script_dispatch
(
script
,
FALSE
);
SET_EXPECT
(
GetLCID
);
SET_EXPECT
(
GetLCID
);
...
@@ -297,6 +310,8 @@ static void test_jscript(void)
...
@@ -297,6 +310,8 @@ static void test_jscript(void)
CHECK_CALLED
(
GetLCID
);
CHECK_CALLED
(
GetLCID
);
CHECK_CALLED
(
OnStateChange_INITIALIZED
);
CHECK_CALLED
(
OnStateChange_INITIALIZED
);
test_state
(
script
,
SCRIPTSTATE_INITIALIZED
);
hres
=
IActiveScript_SetScriptSite
(
script
,
&
ActiveScriptSite
);
hres
=
IActiveScript_SetScriptSite
(
script
,
&
ActiveScriptSite
);
ok
(
hres
==
E_UNEXPECTED
,
"SetScriptSite failed: %08x, expected E_UNEXPECTED
\n
"
,
hres
);
ok
(
hres
==
E_UNEXPECTED
,
"SetScriptSite failed: %08x, expected E_UNEXPECTED
\n
"
,
hres
);
...
@@ -307,6 +322,7 @@ static void test_jscript(void)
...
@@ -307,6 +322,7 @@ static void test_jscript(void)
ok
(
hres
==
S_OK
,
"Close failed: %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"Close failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
OnStateChange_CLOSED
);
CHECK_CALLED
(
OnStateChange_CLOSED
);
test_state
(
script
,
SCRIPTSTATE_CLOSED
);
test_script_dispatch
(
script
,
FALSE
);
test_script_dispatch
(
script
,
FALSE
);
IActiveScriptParse_Release
(
parse
);
IActiveScriptParse_Release
(
parse
);
...
...
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