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
0d011097
Commit
0d011097
authored
Dec 24, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml/tests: Added script element readyState and onreadystatechange tests.
parent
f4b68522
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
2 deletions
+76
-2
events.html
dlls/mshtml/tests/events.html
+74
-2
externscr.js
dlls/mshtml/tests/externscr.js
+2
-0
No files found.
dlls/mshtml/tests/events.html
View file @
0d011097
...
@@ -7,6 +7,10 @@ function ok(b,m) {
...
@@ -7,6 +7,10 @@ function ok(b,m) {
return
external
.
ok
(
b
,
m
);
return
external
.
ok
(
b
,
m
);
}
}
function
broken
(
expr
)
{
return
external
.
broken
(
expr
);
}
function
ondataavailable_test
()
{
function
ondataavailable_test
()
{
var
evobj
,
div
,
b
=
false
;
var
evobj
,
div
,
b
=
false
;
...
@@ -114,8 +118,35 @@ function test_handler_this() {
...
@@ -114,8 +118,35 @@ function test_handler_this() {
ok
(
calls
==
"div2,div2*,div1,div1*,body,body*"
,
"calls = "
+
calls
);
ok
(
calls
==
"div2,div2*,div1,div1*,body,body*"
,
"calls = "
+
calls
);
}
}
function
test_insert_script
()
{
var
e
=
document
.
createElement
(
"script"
);
extern_cnt
=
0
;
e
.
src
=
"externscr.js"
;
var
readystatechange_log
=
""
;
e
.
onreadystatechange
=
function
()
{
readystatechange_log
+=
","
+
e
.
readyState
;
ok
(
extern_cnt
===
1
,
"extern_cnt = "
+
extern_cnt
);
if
(
e
.
readyState
===
"complete"
)
{
ok
(
readystatechange_log
===
"append,complete"
,
"readystatechange_log = "
+
readystatechange_log
);
external
.
reportSuccess
();
}
}
document
.
body
.
appendChild
(
e
);
ok
(
extern_cnt
===
1
,
"extern_cnt = "
+
extern_cnt
);
readystatechange_log
=
"append"
;
}
window
.
onload
=
function
()
{
window
.
onload
=
function
()
{
try
{
try
{
ok
(
inlscr_complete_called
,
"onreadystatechange not fired"
);
ok
(
extern_res_script_rs
===
"eval,complete1,"
,
"extern_res_script_rs = "
+
extern_res_script_rs
+
" expected eval,complete1,"
);
ok
(
extern_http_script_rs
===
"loading,loaded,complete,"
,
"extern_http_script_rs = "
+
extern_http_script_rs
+
" expected loading,loaded,complete,"
);
ok
(
cnt
==
1
,
"cnt="
+
cnt
+
" exception during loading?"
);
ok
(
cnt
==
1
,
"cnt="
+
cnt
+
" exception during loading?"
);
ok
(
this
===
window
,
"this !== window"
);
ok
(
this
===
window
,
"this !== window"
);
...
@@ -127,11 +158,10 @@ window.onload = function() {
...
@@ -127,11 +158,10 @@ window.onload = function() {
test_scriptfor
();
test_scriptfor
();
ondataavailable_test
();
ondataavailable_test
();
test_handler_this
();
test_handler_this
();
test_insert_script
();
}
catch
(
e
)
{
}
catch
(
e
)
{
ok
(
false
,
"Got an exception: "
+
e
.
message
);
ok
(
false
,
"Got an exception: "
+
e
.
message
);
}
}
external
.
reportSuccess
();
}
}
</script>
</script>
<script>
<script>
...
@@ -165,6 +195,48 @@ img.onload = function() {
...
@@ -165,6 +195,48 @@ img.onload = function() {
})();
})();
</script>
</script>
<script>
<script>
var
inlscr_complete_called
=
false
,
extern_res_script_rs
=
""
,
extern_http_script_rs
=
""
;
var
extern_cnt
=
0
;
function
expect_inlscr_complete
()
{
var
elem
=
document
.
getElementById
(
"inlscr"
);
ok
(
elem
.
readyState
===
"complete"
||
broken
(
elem
.
readyState
===
"loading"
),
"expect_inlscr_complete: elem.readyState = "
+
elem
.
readyState
);
if
(
elem
.
readyState
===
"complete"
)
inlscr_complete_called
=
true
;
}
function
extern_res_script_readystatechange
()
{
var
elem
=
document
.
getElementById
(
"extscr"
);
if
(
elem
.
readyState
!=
"loading"
)
extern_res_script_rs
+=
elem
.
readyState
+
extern_cnt
+
","
;
else
external
.
trace
(
"Got loading readyState from external res script."
);
}
function
http_script_readystatechange
()
{
var
elem
=
document
.
getElementById
(
"httpscr"
);
extern_http_script_rs
+=
elem
.
readyState
+
","
;
}
function
on_externscr
()
{
var
elem
=
document
.
getElementById
(
"extscr"
);
ok
(
elem
.
readyState
===
"interactive"
||
broken
(
elem
.
readyState
===
"loading"
),
"on_externscr: elem.readyState = "
+
elem
.
readyState
);
extern_res_script_rs
+=
"eval,"
;
}
</script>
<script
id=
"inlscr"
onreadystatechange=
"expect_inlscr_complete();"
>
(
function
()
{
ok
(
inlscr_complete_called
===
false
||
broken
(
inlscr_complete_called
),
"onreadystatechange fired too early"
);
var
elem
=
document
.
getElementById
(
"inlscr"
);
ok
(
elem
.
readyState
===
"interactive"
,
"inlscr: elem.readyState = "
+
elem
.
readyState
);
})();
</script>
<script
id=
"extscr"
onreadystatechange=
"extern_res_script_readystatechange()"
src=
"externscr.js"
></script>
<script
id=
"httpscr"
onreadystatechange=
"http_script_readystatechange()"
src=
"https://test.winehq.org/tests/empty.js?123456"
></script>
<script>
document
.
body
.
appendChild
(
img
);
document
.
body
.
appendChild
(
img
);
</script>
</script>
</body>
</body>
...
...
dlls/mshtml/tests/externscr.js
View file @
0d011097
extern_cnt
++
;
extern_cnt
++
;
if
(
"on_externscr"
in
window
)
on_externscr
();
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