Skip to content

Commit

Permalink
Bug 1557436 [wpt PR 16734] - Add some initial tests for JSON modules.…
Browse files Browse the repository at this point in the history
…, a=testonly

Automatic update from web-platform-tests
Add some initial tests for JSON modules.

See <whatwg/html#4407>.

--

wp5At-commits: f510720b12c7d0dd3e0639bac35aceb237c2221c
wpt-pr: 16734

UltraBlame original commit: d18767ce41b850b8929ad67e8367a5fb80eda67d
  • Loading branch information
marco-c committed Oct 4, 2019
1 parent de44e5d commit 5b8127d
Show file tree
Hide file tree
Showing 14 changed files with 1,657 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
"
en
"
"
try
"
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
false
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
<
!
DOCTYPE
html
>
<
meta
charset
=
utf
-
8
>
<
title
>
JSON
modules
:
invalid
Content
-
Type
<
/
title
>
<
script
src
=
"
/
resources
/
testharness
.
js
"
>
<
/
script
>
<
script
src
=
"
/
resources
/
testharnessreport
.
js
"
>
<
/
script
>
<
div
id
=
log
>
<
/
div
>
<
script
>
const
content_types
=
[
"
application
/
json
+
protobuf
"
"
application
/
json
+
blah
"
"
text
/
x
-
json
"
"
text
/
json
+
blah
"
"
application
/
blahjson
"
"
image
/
json
"
]
;
for
(
const
content_type
of
content_types
)
{
async_test
(
t
=
>
{
const
script
=
document
.
createElement
(
"
script
"
)
;
script
.
onerror
=
t
.
step_func_done
(
)
;
script
.
onload
=
t
.
unreached_func
(
"
Should
not
load
"
)
;
script
.
type
=
"
module
"
;
script
.
src
=
module
.
json
?
pipe
=
header
(
Content
-
Type
{
content_type
}
)
;
document
.
body
.
appendChild
(
script
)
;
}
content_type
)
;
}
<
/
script
>
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
<
!
DOCTYPE
html
>
<
meta
charset
=
utf
-
8
>
<
title
>
JSON
modules
<
/
title
>
<
script
src
=
"
/
resources
/
testharness
.
js
"
>
<
/
script
>
<
script
src
=
"
/
resources
/
testharnessreport
.
js
"
>
<
/
script
>
<
div
id
=
log
>
<
/
div
>
<
script
>
const
t
=
async_test
(
)
;
<
/
script
>
<
script
type
=
"
module
"
onerror
=
"
t
.
step
(
(
)
=
>
assert_unreached
(
event
)
)
"
>
import
v
from
"
.
/
module
.
json
"
;
t
.
step
(
(
)
=
>
{
assert_equals
(
typeof
v
"
object
"
)
;
assert_array_equals
(
Object
.
keys
(
v
)
[
"
test
"
]
)
;
assert_equals
(
v
.
test
true
)
;
t
.
done
(
)
;
}
)
;
<
/
script
>
Loading

0 comments on commit 5b8127d

Please sign in to comment.