Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: LayoutTests/fast/dom/document-contentType-data-uri.html

Issue 151653004: Implemented Document.contentType (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..fe97ee1ffc11bb929c2115816d6bacf0314a796a
--- /dev/null
+++ b/LayoutTests/fast/dom/document-contentType-data-uri.html
@@ -0,0 +1,38 @@
+<!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)
+ shouldBe('"' + e.data.obtained + '"', '"' + e.data.expected + '"');
+ else
+ testFailed("Null message payload");
+
+ if (--expectedMessagesCount == 0)
+ finishJSTest();
+};
+
+var documentContents = '<script xmlns="http://www.w3.org/1999/xhtml">' +
+ 'parent.postMessage(' +
+ '{obtained: document.contentType, expected: "{0}"}, "*");' +
+ '<' + '/script>';
+
+var iframes = document.getElementsByTagName('iframe');
+for (var k = 0, f; f = iframes[k]; k++) {
+ f.src = 'data:' + f.dataset.mt + ',' +
+ encodeURIComponent(documentContents.replace('{0}', f.dataset.mt));
+}
+
+var expectedMessagesCount = iframes.length;
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698