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
514e65c1
Commit
514e65c1
authored
Sep 24, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use custom VT_BSTR to VT_BOOL conversion in InvokeEx implementation.
parent
4d469b55
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
1 deletion
+95
-1
dispex.c
dlls/mshtml/dispex.c
+10
-0
jstest.html
dlls/mshtml/tests/jstest.html
+28
-1
script.c
dlls/mshtml/tests/script.c
+57
-0
No files found.
dlls/mshtml/dispex.c
View file @
514e65c1
...
...
@@ -927,6 +927,16 @@ static HRESULT change_type(VARIANT *dst, VARIANT *src, VARTYPE vt, IServiceProvi
}
}
switch
(
vt
)
{
case
VT_BOOL
:
if
(
V_VT
(
src
)
==
VT_BSTR
)
{
V_VT
(
dst
)
=
VT_BOOL
;
V_BOOL
(
dst
)
=
V_BSTR
(
src
)
&&
*
V_BSTR
(
src
)
?
VARIANT_TRUE
:
VARIANT_FALSE
;
return
S_OK
;
}
break
;
}
return
VariantChangeType
(
dst
,
src
,
0
,
vt
);
}
...
...
dlls/mshtml/tests/jstest.html
View file @
514e65c1
...
...
@@ -98,6 +98,24 @@ function test_clone_node() {
ok
(
cloned
.
style
.
filter
===
"alpha(opacity=50)"
,
"cloned.style.filter = "
+
cloned
.
style
.
filter
);
}
function
test_setAttribute
()
{
var
input
;
document
.
body
.
innerHTML
=
'<input id="inputid"></input>'
;
input
=
document
.
getElementById
(
"inputid"
);
ok
(
input
.
checked
===
false
,
"input.checked = "
+
input
.
checked
);
input
.
setAttribute
(
"checked"
,
"test"
);
ok
(
input
.
checked
===
true
,
"input.checked = "
+
input
.
checked
);
input
.
setAttribute
(
"checked"
,
0
);
ok
(
input
.
checked
===
false
,
"input.checked = "
+
input
.
checked
);
input
.
setAttribute
(
"checked"
,
""
);
ok
(
input
.
checked
===
false
,
"input.checked = "
+
input
.
checked
);
}
function
test_getter_call
()
{
document
.
body
.
innerHTML
=
'<div id="divid"></div>'
;
...
...
@@ -133,7 +151,7 @@ function test_override_functions() {
var
globalVar
=
false
;
function
runTest
()
{
function
runTest
s
()
{
obj
=
new
Object
();
ok
(
obj
===
window
.
obj
,
"obj !== window.obj"
);
...
...
@@ -147,11 +165,20 @@ function runTest() {
test_document_name_as_index
();
test_remove_style_attribute
();
test_getter_call
();
test_setAttribute
();
test_override_functions
();
var
r
=
window
.
execScript
(
"globalVar = true;"
);
ok
(
r
===
undefined
,
"execScript returned "
+
r
);
ok
(
globalVar
===
true
,
"globalVar = "
+
globalVar
);
}
function
runTest
()
{
try
{
runTests
();
}
catch
(
e
)
{
ok
(
false
,
"got exception"
);
}
external
.
reportSuccess
();
}
...
...
dlls/mshtml/tests/script.c
View file @
514e65c1
...
...
@@ -2028,6 +2028,62 @@ static void test_arg_conv(IHTMLWindow2 *window)
IDispatchEx_Release
(
dispex
);
}
#define test_elem_disabled(a,b) _test_elem_disabled(__LINE__,a,b)
static
void
_test_elem_disabled
(
unsigned
line
,
IHTMLElement
*
elem
,
VARIANT_BOOL
exb
)
{
IHTMLElement3
*
elem3
;
VARIANT_BOOL
b
=
100
;
HRESULT
hres
;
hres
=
IHTMLElement_QueryInterface
(
elem
,
&
IID_IHTMLElement3
,
(
void
**
)
&
elem3
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"Could not get IHTMLElement3 iface: %08x
\n
"
,
hres
);
hres
=
IHTMLElement3_get_disabled
(
elem3
,
&
b
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_disabled failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
b
==
exb
,
"disabled = %x, expected %x
\n
"
,
b
,
exb
);
IHTMLElement3_Release
(
elem3
);
}
static
void
test_default_arg_conv
(
IHTMLWindow2
*
window
)
{
IHTMLDocument2
*
doc
;
IDispatchEx
*
dispex
;
IHTMLElement
*
elem
;
VARIANT
v
;
HRESULT
hres
;
hres
=
IHTMLWindow2_get_document
(
window
,
&
doc
);
ok
(
hres
==
S_OK
,
"get_document failed: %08x
\n
"
,
hres
);
hres
=
IHTMLDocument2_get_body
(
doc
,
&
elem
);
IHTMLDocument2_Release
(
doc
);
ok
(
hres
==
S_OK
,
"get_body failed: %08x
\n
"
,
hres
);
hres
=
IHTMLElement_QueryInterface
(
elem
,
&
IID_IDispatchEx
,
(
void
**
)
&
dispex
);
ok
(
hres
==
S_OK
,
"Could not get IDispatchEx iface: %08x
\n
"
,
hres
);
test_elem_disabled
(
elem
,
VARIANT_FALSE
);
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
a2bstr
(
"test"
);
hres
=
dispex_propput
(
dispex
,
DISPID_IHTMLELEMENT3_DISABLED
,
0
,
&
v
,
NULL
);
ok
(
hres
==
S_OK
,
"InvokeEx failed: %08x
\n
"
,
hres
);
SysFreeString
(
V_BSTR
(
&
v
));
test_elem_disabled
(
elem
,
VARIANT_TRUE
);
V_VT
(
&
v
)
=
VT_I4
;
V_BSTR
(
&
v
)
=
0
;
hres
=
dispex_propput
(
dispex
,
DISPID_IHTMLELEMENT3_DISABLED
,
0
,
&
v
,
NULL
);
ok
(
hres
==
S_OK
,
"InvokeEx failed: %08x
\n
"
,
hres
);
test_elem_disabled
(
elem
,
VARIANT_FALSE
);
IHTMLElement_Release
(
elem
);
IDispatchEx_Release
(
dispex
);
}
static
void
test_script_run
(
void
)
{
IDispatchEx
*
document
,
*
dispex
;
...
...
@@ -2198,6 +2254,7 @@ static void test_script_run(void)
test_nextdispid
(
dispex
);
test_arg_conv
(
window
);
test_default_arg_conv
(
window
);
IHTMLWindow2_Release
(
window
);
tmp
=
a2bstr
(
"test"
);
...
...
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