Index: LayoutTests/fast/dom/document-contentType-data-uri.html |
diff --git a/LayoutTests/fast/dom/document-contentType-data-uri.html b/LayoutTests/fast/dom/document-contentType-data-uri.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..564fac904e48ba9095245352c480e3febb857c96 |
--- /dev/null |
+++ b/LayoutTests/fast/dom/document-contentType-data-uri.html |
@@ -0,0 +1,37 @@ |
+<!DOCTYPE html> |
+<title>document.contentType</title> |
+<link rel="help" href="http://dom.spec.whatwg.org/#dom-document-contenttype"> |
+<script src="../../resources/js-test.js"></script> |
+<body> |
+<p> |
+<iframe data-mt="text/html"></iframe> |
+<iframe data-mt="text/xml"></iframe> |
+<iframe data-mt="application/xml"></iframe> |
+<iframe data-mt="image/svg+xml"></iframe> |
+</p> |
+<script> |
+window.jsTestIsAsync = true; |
+ |
+window.onmessage = function(e) { |
+ if (e.data) |
arv (Not doing code reviews)
2014/02/11 16:36:10
Wrong indentation
|
+ shouldBe('"' + e.data.obtained + '"', '"' + e.data.expected + '"'); |
+ else |
+ testFailed("Null message payload"); |
+ |
+ if (--expected_messages == 0) |
+ finishJSTest(); |
+}; |
+ |
+var document_contents = '<script xmlns="http://www.w3.org/1999/xhtml">' + |
arv (Not doing code reviews)
2014/02/11 16:36:10
no underscores in js
|
+ 'parent.postMessage(' + |
+ '{obtained: document.contentType, expected: "{0}"}, "*");' + |
+ '<' + '/script>'; |
+ |
+var iframes = document.body.getElementsByTagName('iframe'); |
arv (Not doing code reviews)
2014/02/11 16:36:10
document.querySelector('iframe') or document.getEl
|
+for (var k = 0, f; f = iframes[k]; k++) |
+ f.src = 'data:' + f.dataset.mt + ',' + |
+ encodeURIComponent(document_contents.replace('{0}', f.dataset.mt)); |
+ |
+var expected_messages = iframes.length; |
+ |
+</script> |