forked from web-platform-tests/wpt
-
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.
Test the BlobEvent constructor (web-platform-tests#3749)
This is for the new BlobEvent("type", { data: null }) test, which fails in Chromium, see https://crbug.com/647693
- Loading branch information
Showing
2 changed files
with
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!doctype html> | ||
<title>BlobEvent constructor</title> | ||
<link rel="help" href="https://w3c.github.io/mediacapture-record/MediaRecorder.html#blob-event"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(function() { | ||
assert_equals(BlobEvent.length, 2); | ||
assert_throws(new TypeError, function() { | ||
new BlobEvent("type"); | ||
}); | ||
assert_throws(new TypeError, function() { | ||
new BlobEvent("type", null); | ||
}); | ||
assert_throws(new TypeError, function() { | ||
new BlobEvent("type", undefined); | ||
}); | ||
}, "The BlobEventInit dictionary is required"); | ||
|
||
test(function() { | ||
assert_throws(new TypeError, function() { | ||
new BlobEvent("type", {}); | ||
}); | ||
assert_throws(new TypeError, function() { | ||
new BlobEvent("type", { data: null }); | ||
}); | ||
assert_throws(new TypeError, function() { | ||
new BlobEvent("type", { data: undefined }); | ||
}); | ||
}, "The BlobEventInit dictionary's data member is required."); | ||
|
||
test(function() { | ||
var blob = new Blob(); | ||
var event = new BlobEvent("type", { data: blob }); | ||
assert_equals(event.type, "type"); | ||
assert_equals(event.data, blob); | ||
}, "The BlobEvent instance's data attribute is set."); | ||
</script> |
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 @@ | ||
@miguelao |