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

Unified Diff: LayoutTests/http/tests/xmlhttprequest/response-blob-mimetype.html

Issue 887693002: Lower Received MIME type when creating a response blob. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/response-blob-mimetype-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/xmlhttprequest/response-blob-mimetype.html
diff --git a/LayoutTests/http/tests/xmlhttprequest/response-blob-mimetype.html b/LayoutTests/http/tests/xmlhttprequest/response-blob-mimetype.html
new file mode 100644
index 0000000000000000000000000000000000000000..ee05797567ff4e6c8ac35a1c337fc12f9699cd2e
--- /dev/null
+++ b/LayoutTests/http/tests/xmlhttprequest/response-blob-mimetype.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<body>
+
+<script src="/js-test-resources/js-test.js"></script>
+
+<script>
+description('This tests that XMLHttpRequest lowers the MIME Type when creates a response blob.');
+window.jsTestIsAsync = true;
+
+function get(url) {
+ return new Promise(function(resolve, reject) {
+ var xhr = new XMLHttpRequest();
+ var blob = new Blob(['Test Content']);
+ xhr.responseType = 'blob';
+ xhr.open('GET', url, true);
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState === 4) {
+ resolve(xhr);
+ }
+ }
+ xhr.send(blob);
+ });
+}
+
+get('/dom/resources/send-mime-type.php?m=MULTIPART/MIXED').then(function(xhr) {
+ returnedMimeType = xhr.response.type;
+ shouldBeEqualToString("returnedMimeType", "multipart/mixed");
+
+ return get('/dom/resources/send-mime-type.php?m=Text/Plain');
+}).then(function(xhr) {
+ returnedMimeType = xhr.response.type;
+ shouldBeEqualToString("returnedMimeType", "text/plain");
+}).catch(function(reason) {
+ testFailed(String(reason));
+}).then(finishJSTest, finishJSTest);
+
+</script>
+</body>
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/response-blob-mimetype-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698