Check the contentType attribute for media documents.

This commit is contained in:
Ms2ger 2017-01-26 15:25:49 +01:00
parent 15a0547b07
commit c853337d64
3 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1,5 @@
[pageload-image.html]
type: testharness
[The document for a standalone media file should have one child in the body.]
expected: FAIL

View file

@ -13,6 +13,7 @@
function frameLoaded() {
var testframe = document.getElementById('testframe');
assert_equals(testframe.contentDocument.contentType, "image/png");
var testframeChildren = testframe.contentDocument.body.childNodes;
assert_equals(testframeChildren.length, 1, "Body of image document has 1 child");
assert_equals(testframeChildren[0].nodeName, "IMG", "Only child of body must be an <img> element");

View file

@ -13,6 +13,7 @@
function frameLoaded() {
var testframe = document.getElementById('testframe');
assert_equals(testframe.contentDocument.contentType, "video/webm");
var testframeChildren = testframe.contentDocument.body.childNodes;
assert_equals(testframeChildren.length, 1, "Body of image document has 1 child");
assert_equals(testframeChildren[0].nodeName, "VIDEO", "Only child of body must be an <video> element");