blob: 5e8f68029f11655571ed689a38f22d4f633c0675 [file] [log] [blame]
This tests DOMParser supports creating Document for HTML content with mime-type "text/html".
1. Should support mime-type = "text/html"
HTML content:
Scripts must be disabled for the document created using DOMParser.parseFromString()
Sample text content
PASS
2. Should support mime-type = "text/xml"
Root element: root
PASS
3. Should support mime-type = "application/xml"
Root element: root
PASS
4. Should support mime-type = "application/xhtml+xml"
Root element: html
PASS
5. Should support mime-type = "image/svg+xml"
Root element: svg
PASS
6. Should THROW exception for mime-type = "text/xsl"
TypeError: Failed to execute 'parseFromString' on 'DOMParser': Unsupported mime-type specified.
PASS
7. Should THROW exception for mime-type = "text/dummy+xml"
TypeError: Failed to execute 'parseFromString' on 'DOMParser': Unsupported mime-type specified.
PASS
8. Should THROW exception for mime-type = "text/XML"
TypeError: Failed to execute 'parseFromString' on 'DOMParser': Unsupported mime-type specified.
PASS
9. Should THROW exception for mime-type = "TEXT/html"
TypeError: Failed to execute 'parseFromString' on 'DOMParser': Unsupported mime-type specified.
PASS