-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1516063 [wpt PR 14637] - html, xhr: Add tests for 'formdata' even…
…t, a=testonly Automatic update from web-platform-tests html, xhr: Add tests for 'formdata' event (#14637) Specification PR: whatwg/html#4239 -- wpt-commits: c547389199647f1736be244a7ca5a874da692430 wpt-pr: 14637 UltraBlame original commit: c71f7d3fa10b69185c90a1537bb49989a0fd4604
- Loading branch information
Showing
7 changed files
with
1,755 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
311 changes: 311 additions & 0 deletions
311
testing/web-platform/tests/html/semantics/forms/form-submission-0/FormDataEvent.window.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,311 @@ | ||
/ | ||
/ | ||
https | ||
: | ||
/ | ||
/ | ||
html | ||
. | ||
spec | ||
. | ||
whatwg | ||
. | ||
org | ||
/ | ||
multipage | ||
/ | ||
form | ||
- | ||
control | ||
- | ||
infrastructure | ||
. | ||
html | ||
# | ||
the | ||
- | ||
formdataevent | ||
- | ||
interface | ||
test | ||
( | ||
( | ||
) | ||
= | ||
> | ||
{ | ||
let | ||
fd | ||
= | ||
new | ||
FormData | ||
( | ||
) | ||
; | ||
let | ||
typeError | ||
= | ||
new | ||
TypeError | ||
( | ||
) | ||
; | ||
assert_throws | ||
( | ||
typeError | ||
( | ||
) | ||
= | ||
> | ||
{ | ||
new | ||
FormDataEvent | ||
( | ||
) | ||
} | ||
' | ||
0 | ||
arguments | ||
' | ||
) | ||
; | ||
assert_throws | ||
( | ||
typeError | ||
( | ||
) | ||
= | ||
> | ||
{ | ||
new | ||
FormDataEvent | ||
( | ||
' | ||
foo | ||
' | ||
) | ||
} | ||
' | ||
1 | ||
argument | ||
' | ||
) | ||
; | ||
assert_throws | ||
( | ||
typeError | ||
( | ||
) | ||
= | ||
> | ||
{ | ||
new | ||
FormDataEvent | ||
( | ||
fd | ||
fd | ||
) | ||
} | ||
' | ||
2 | ||
invalid | ||
arguments | ||
' | ||
) | ||
; | ||
assert_throws | ||
( | ||
typeError | ||
( | ||
) | ||
= | ||
> | ||
{ | ||
new | ||
FormDataEvent | ||
( | ||
' | ||
foo | ||
' | ||
null | ||
) | ||
} | ||
' | ||
Null | ||
dictionary | ||
' | ||
) | ||
; | ||
assert_throws | ||
( | ||
typeError | ||
( | ||
) | ||
= | ||
> | ||
{ | ||
new | ||
FormDataEvent | ||
( | ||
' | ||
foo | ||
' | ||
undefined | ||
) | ||
} | ||
' | ||
Undefined | ||
dictionary | ||
' | ||
) | ||
; | ||
assert_throws | ||
( | ||
typeError | ||
( | ||
) | ||
= | ||
> | ||
{ | ||
new | ||
FormDataEvent | ||
( | ||
' | ||
foo | ||
' | ||
{ | ||
formData | ||
: | ||
null | ||
} | ||
) | ||
} | ||
' | ||
Null | ||
formData | ||
' | ||
) | ||
; | ||
assert_throws | ||
( | ||
typeError | ||
( | ||
) | ||
= | ||
> | ||
{ | ||
new | ||
FormDataEvent | ||
( | ||
' | ||
foo | ||
' | ||
{ | ||
formData | ||
: | ||
undefined | ||
} | ||
) | ||
} | ||
' | ||
Undefined | ||
formData | ||
' | ||
) | ||
; | ||
assert_throws | ||
( | ||
typeError | ||
( | ||
) | ||
= | ||
> | ||
{ | ||
new | ||
FormDataEvent | ||
( | ||
' | ||
foo | ||
' | ||
{ | ||
formData | ||
: | ||
' | ||
bar | ||
' | ||
} | ||
) | ||
} | ||
' | ||
Wrong | ||
type | ||
of | ||
formData | ||
' | ||
) | ||
; | ||
} | ||
' | ||
Failing | ||
FormDataEvent | ||
constructor | ||
' | ||
) | ||
; | ||
test | ||
( | ||
( | ||
) | ||
= | ||
> | ||
{ | ||
let | ||
fd | ||
= | ||
new | ||
FormData | ||
( | ||
) | ||
; | ||
let | ||
event | ||
= | ||
new | ||
FormDataEvent | ||
( | ||
' | ||
bar | ||
' | ||
{ | ||
formData | ||
: | ||
fd | ||
bubbles | ||
: | ||
true | ||
} | ||
) | ||
; | ||
assert_equals | ||
( | ||
event | ||
. | ||
formData | ||
fd | ||
) | ||
; | ||
assert_true | ||
( | ||
event | ||
. | ||
bubbles | ||
) | ||
; | ||
} | ||
' | ||
Successful | ||
FormDataEvent | ||
constructor | ||
' | ||
) | ||
; |
Oops, something went wrong.