summaryrefslogtreecommitdiff
path: root/parser/htmlparser
diff options
context:
space:
mode:
authorJustOff <Off.Just.Off@gmail.com>2017-11-17 21:14:20 +0200
committerJustOff <Off.Just.Off@gmail.com>2017-11-17 21:14:20 +0200
commit2b145a4ed3d616a1cfc75be6abc9c7028aee49f4 (patch)
treec908bbe8a0057295457146bc3fc038fe4537e3cd /parser/htmlparser
parent83098db2044b3f28abdd74f0b0b74b01ba293e12 (diff)
downloadpalemoon-gre-2b145a4ed3d616a1cfc75be6abc9c7028aee49f4.tar.gz
Add text/json and text/vtt as text MIME types
Diffstat (limited to 'parser/htmlparser')
-rw-r--r--parser/htmlparser/tests/mochitest/mochitest.ini2
-rw-r--r--parser/htmlparser/tests/mochitest/test_bug1209658.html35
-rw-r--r--parser/htmlparser/tests/mochitest/test_bug667533.html28
3 files changed, 36 insertions, 29 deletions
diff --git a/parser/htmlparser/tests/mochitest/mochitest.ini b/parser/htmlparser/tests/mochitest/mochitest.ini
index 0000ba9fc..98af49e2e 100644
--- a/parser/htmlparser/tests/mochitest/mochitest.ini
+++ b/parser/htmlparser/tests/mochitest/mochitest.ini
@@ -120,7 +120,6 @@ support-files =
[test_bug642908.html]
[test_bug645115.html]
[test_bug655682.html]
-[test_bug667533.html]
[test_bug672453.html]
[test_bug688580.html]
[test_bug688580.xhtml]
@@ -144,3 +143,4 @@ skip-if = (os == 'mac' && debug) # Bug 1129538
# file_bug568470-script.sjs
# Disable test due to frequent orange on Mac
# test_bug534293.html
+[test_bug1209658.html]
diff --git a/parser/htmlparser/tests/mochitest/test_bug1209658.html b/parser/htmlparser/tests/mochitest/test_bug1209658.html
new file mode 100644
index 000000000..f8704626b
--- /dev/null
+++ b/parser/htmlparser/tests/mochitest/test_bug1209658.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1209658
+-->
+<head>
+ <title>Test for Bug 1209658</title>
+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1209658">Mozilla Bug 1209658</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<script type="application/javascript">
+SimpleTest.waitForExplicitFinish();
+
+addLoadEvent(function loaded() {
+ for (var iframe of document.querySelectorAll("iframe")) {
+ is(iframe.contentWindow.location.href, iframe.src, "should load correct URL");
+ is(iframe.contentDocument.body.textContent, '{"<p>Hello</p>": null}',
+ iframe.getAttribute("mimeType") + " should be treated as text");
+ }
+ SimpleTest.finish();
+});
+</script>
+<iframe src="data:text/json,{&quot;<p>Hello</p>&quot;:%20null}"
+ mimeType="text/json"></iframe>
+<!-- Totally not valid VTT data, but doesn't matter for our purposes here -->
+<iframe src="data:text/vtt,{&quot;<p>Hello</p>&quot;:%20null}"
+ mimeType="text/vtt"></iframe>
+</body>
+</html>
diff --git a/parser/htmlparser/tests/mochitest/test_bug667533.html b/parser/htmlparser/tests/mochitest/test_bug667533.html
deleted file mode 100644
index c5b24394e..000000000
--- a/parser/htmlparser/tests/mochitest/test_bug667533.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=667533
--->
-<head>
- <title>Test for Bug 667533</title>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=667533">Mozilla Bug 667533</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<script type="application/javascript">
-SimpleTest.waitForExplicitFinish();
-
-function loaded(iframe) {
- is(iframe.contentWindow.location.href, iframe.src, "should load correct URL");
- is(iframe.contentDocument.body.textContent, '{"<p>Hello</p>": null}', "application/json should be treated as text");
- SimpleTest.finish();
-}
-</script>
-<iframe src="data:application/json,{&quot;<p>Hello</p>&quot;:%20null}" onload="loaded(this);"></iframe>
-</body>
-</html>