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
2c2f5761
Commit
2c2f5761
authored
Nov 28, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added more attribute and IDispatchEx tests.
parent
53e9acbf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
126 additions
and
3 deletions
+126
-3
jstest.html
dlls/mshtml/tests/jstest.html
+107
-3
script.c
dlls/mshtml/tests/script.c
+19
-0
No files found.
dlls/mshtml/tests/jstest.html
View file @
2c2f5761
...
...
@@ -5,6 +5,10 @@ function ok(b,m) {
return
external
.
ok
(
b
,
m
);
}
function
broken
(
expr
)
{
return
external
.
broken
(
expr
);
}
function
test_removeAttribute
(
e
)
{
ok
(
e
.
removeAttribute
(
'nonexisting'
)
===
false
,
"removeAttribute('nonexisting') didn't return false"
);
...
...
@@ -98,11 +102,13 @@ function test_clone_node() {
ok
(
cloned
.
style
.
filter
===
"alpha(opacity=50)"
,
"cloned.style.filter = "
+
cloned
.
style
.
filter
);
}
function
test_
setAttribute
()
{
var
input
;
function
test_
attrs
()
{
var
input
,
s
,
x
,
f
,
b
;
document
.
body
.
innerHTML
=
'<input id="inputid"></input>'
;
input
=
document
.
getElementById
(
"inputid"
);
s
=
input
.
style
;
f
=
input
.
fireEvent
;
ok
(
input
.
checked
===
false
,
"input.checked = "
+
input
.
checked
);
input
.
setAttribute
(
"checked"
,
"test"
);
...
...
@@ -113,6 +119,104 @@ function test_setAttribute() {
input
.
setAttribute
(
"checked"
,
""
);
ok
(
input
.
checked
===
false
,
"input.checked = "
+
input
.
checked
);
input
.
setAttribute
(
"Checked"
,
1
,
0
);
ok
(
input
.
checked
===
true
,
"input.checked = "
+
input
.
checked
);
ok
(
!
(
"Checked"
in
input
),
"Checked added to input"
);
input
.
setAttribute
(
"checked"
,
0
,
0
);
input
.
setAttribute
(
"Checked"
,
1
,
1
);
ok
(
input
.
checked
===
false
,
"input.checked = "
+
input
.
checked
);
ok
(
"Checked"
in
input
,
"checked not added to input"
);
ok
(
input
.
Checked
===
1
,
"input.Checked = "
+
input
.
Checked
);
input
.
removeAttribute
(
"Checked"
,
1
);
ok
(
!
(
"Checked"
in
input
),
"Checked is still in input"
);
ok
(
input
.
checked
===
false
,
"input.checked = "
+
input
.
checked
);
input
.
setAttribute
(
"checked"
,
1
,
0
);
input
.
setAttribute
(
"Checked"
,
0
);
ok
(
input
.
checked
===
true
,
"input.checked = "
+
input
.
checked
);
ok
(
"Checked"
in
input
,
"checked not added to input"
);
ok
(
input
.
Checked
===
0
,
"input.Checked = "
+
input
.
Checked
);
input
.
setAttribute
(
"Checked"
,
2
,
2
);
ok
(
input
.
Checked
===
0
,
"input.Checked = "
+
input
.
Checked
);
input
.
setAttribute
(
"Checked"
,
3
,
3
);
ok
(
input
.
Checked
===
3
,
"input.Checked = "
+
input
.
Checked
);
x
=
input
.
getAttribute
(
"style"
);
ok
(
x
===
s
,
"getAttribute('style') = "
+
x
);
ok
(
s
.
cssText
===
""
,
"s.cssText = "
+
s
.
cssText
);
input
.
setAttribute
(
"style"
,
"display: none"
);
x
=
input
.
getAttribute
(
"style"
);
ok
(
x
===
s
,
"getAttribute('style') = "
+
x
);
ok
(
s
.
cssText
===
""
,
"s.cssText = "
+
s
.
cssText
);
ok
(
s
.
display
===
""
,
"s.display = "
+
s
.
display
);
s
.
display
=
"none"
;
ok
(
s
.
cssText
!=
""
,
"s.cssText = "
+
s
.
cssText
);
ok
(
s
.
display
===
"none"
,
"s.display = "
+
s
.
display
);
input
.
setAttribute
(
"style"
,
""
);
x
=
input
.
getAttribute
(
"style"
);
ok
(
x
===
s
,
"getAttribute('style') = "
+
x
);
ok
(
s
.
cssText
!=
""
,
"s.cssText = "
+
s
.
cssText
);
ok
(
s
.
display
===
"none"
,
"s.display = "
+
s
.
display
);
input
.
setAttribute
(
"style"
,
null
);
x
=
input
.
getAttribute
(
"style"
);
ok
(
input
.
style
===
s
,
"input.style = "
+
input
.
style
);
ok
(
x
===
s
,
"getAttribute('style') = "
+
x
);
ok
(
s
.
cssText
!=
""
,
"s.cssText = "
+
s
.
cssText
);
ok
(
s
.
display
===
"none"
,
"s.display = "
+
s
.
display
);
x
=
input
.
getAttribute
(
"fireEvent"
);
ok
(
x
===
input
.
fireEvent
,
"input.getAttribute('fireEvent') = "
+
x
);
input
.
setAttribute
(
"fireEvent"
,
3
);
ok
(
input
.
fireEvent
===
3
,
"input.fireEvent = "
+
input
.
fireEvent
);
x
=
input
.
getAttribute
(
"fireEvent"
);
ok
(
x
===
3
,
"input.getAttribute('fireEvent') = "
+
x
);
b
=
input
.
removeAttribute
(
"style"
);
ok
(
b
===
true
,
"removeAttribute('style') failed"
);
ok
(
input
.
style
===
s
,
"input.style = "
+
input
.
style
);
x
=
input
.
getAttribute
(
"style"
);
ok
(
x
===
s
,
"getAttribute('style') = "
+
x
);
ok
(
s
.
display
===
""
,
"s.display = "
+
s
.
display
);
ok
(
s
.
cssText
===
""
,
"s.cssText = "
+
s
.
cssText
);
b
=
input
.
removeAttribute
(
"style"
);
ok
(
b
===
true
,
"removeAttribute('style') failed"
);
b
=
false
;
try
{
input
.
setAttribute
(
"tagName"
,
"xxx"
);
}
catch
(
e
)
{
b
=
true
;
}
ok
(
b
,
"Expected exception on setAttribute(tagName)"
);
b
=
false
;
try
{
input
.
setAttribute
(
"parentElement"
,
"xxx"
);
}
catch
(
e
)
{
b
=
true
;
}
ok
(
b
,
"Expected exception on setAttribute(parentElement)"
);
b
=
input
.
removeAttribute
(
"fireEvent"
);
ok
(
b
===
true
,
"removeAttribute(fireEvent) failed"
);
ok
(
input
.
fireEvent
===
f
,
"input.fireEvent = "
+
input
.
fireEvent
);
x
=
input
.
getAttribute
(
"fireEvent"
);
ok
(
x
===
f
,
"input.getAttribute('fireEvent') = "
+
x
);
b
=
input
.
removeAttribute
(
"fireEvent"
);
ok
(
b
===
false
||
broken
(
b
===
true
),
"removeAttribute(fireEvent) returned "
+
b
);
input
.
fireEvent
=
3
;
x
=
input
.
getAttribute
(
"fireEvent"
);
ok
(
x
===
3
,
"input.getAttribute('fireEvent') = "
+
x
);
ok
(
input
.
fireEvent
===
3
,
"input.fireEvent' = "
+
input
.
fireEvent
);
}
function
test_attribute_collection
()
{
...
...
@@ -239,7 +343,7 @@ function runTests() {
test_document_name_as_index
();
test_remove_style_attribute
();
test_getter_call
();
test_
setAttribute
();
test_
attrs
();
test_attribute_collection
();
test_arg_conv
();
test_override_functions
();
...
...
dlls/mshtml/tests/script.c
View file @
2c2f5761
...
...
@@ -146,6 +146,7 @@ DEFINE_EXPECT(ChangeType);
#define DISPID_EXTERNAL_TRACE 0x300001
#define DISPID_EXTERNAL_REPORTSUCCESS 0x300002
#define DISPID_EXTERNAL_TODO_WINE_OK 0x300003
#define DISPID_EXTERNAL_BROKEN 0x300004
static
const
GUID
CLSID_TestScript
=
{
0x178fc163
,
0xf585
,
0x4e24
,{
0x9c
,
0x13
,
0x4b
,
0xb7
,
0xfa
,
0xf8
,
0x07
,
0x46
}};
...
...
@@ -594,6 +595,10 @@ static HRESULT WINAPI externalDisp_GetDispID(IDispatchEx *iface, BSTR bstrName,
*
pid
=
DISPID_EXTERNAL_TODO_WINE_OK
;
return
S_OK
;
}
if
(
!
strcmp_wa
(
bstrName
,
"broken"
))
{
*
pid
=
DISPID_EXTERNAL_BROKEN
;
return
S_OK
;
}
ok
(
0
,
"unexpected name %s
\n
"
,
wine_dbgstr_w
(
bstrName
));
return
DISP_E_UNKNOWNNAME
;
...
...
@@ -673,6 +678,20 @@ static HRESULT WINAPI externalDisp_InvokeEx(IDispatchEx *iface, DISPID id, LCID
return
S_OK
;
case
DISPID_EXTERNAL_BROKEN
:
ok
(
wFlags
==
INVOKE_FUNC
||
wFlags
==
(
INVOKE_FUNC
|
INVOKE_PROPERTYGET
),
"wFlags = %x
\n
"
,
wFlags
);
ok
(
pdp
!=
NULL
,
"pdp == NULL
\n
"
);
ok
(
pdp
->
rgvarg
!=
NULL
,
"rgvarg == NULL
\n
"
);
ok
(
!
pdp
->
rgdispidNamedArgs
,
"rgdispidNamedArgs != NULL
\n
"
);
ok
(
pdp
->
cArgs
==
1
,
"cArgs = %d
\n
"
,
pdp
->
cArgs
);
ok
(
!
pdp
->
cNamedArgs
,
"cNamedArgs = %d
\n
"
,
pdp
->
cNamedArgs
);
ok
(
pei
!=
NULL
,
"pei == NULL
\n
"
);
ok
(
V_VT
(
pdp
->
rgvarg
)
==
VT_BOOL
,
"V_VT(psp->rgvargs) = %d
\n
"
,
V_VT
(
pdp
->
rgvarg
));
V_VT
(
pvarRes
)
=
VT_BOOL
;
V_BOOL
(
pvarRes
)
=
broken
(
V_BOOL
(
pdp
->
rgvarg
))
?
VARIANT_TRUE
:
VARIANT_FALSE
;
return
S_OK
;
default:
ok
(
0
,
"unexpected call
\n
"
);
return
E_NOTIMPL
;
...
...
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