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

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: 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..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>

Powered by Google App Engine
This is Rietveld 408576698