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

Side by Side Diff: LayoutTests/imported/web-platform-tests/FileAPI/url/url_xmlhttprequest.html

Issue 1236713002: Import FileAPI tests from web-platform-tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Ugh, stupid baselines Created 5 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <title>FileAPI Test: Creating Blob URL via XMLHttpRequest</title>
4 <link rel="author" title="Intel" href="http://www.intel.com">
5 <link rel="author" title="JunChen Xia" href="mailto:xjconlyme@gmail.com">
6 <script src="../../../../resources/testharness.js"></script>
7 <script src="../../../../resources/testharnessreport.js"></script>
8
9 <div id="log"></div>
10
11 <script>
12 async_test(function () {
13 var http = new XMLHttpRequest();
14 http.open("GET", "/images/blue96x96.png", true);
15 http.responseType = "blob";
16 http.onloadend = this.step_func(function(evt) {
17 var blobURI = window.URL.createObjectURL(http.response);
18 assert_true(http.response instanceof Blob, "XMLHttpRequest returns instanc eof Blob");
19 assert_equals(typeof blobURI, "string", "Blob URI is typeof string");
20 assert_equals(blobURI.indexOf("blob"), 0, "Blob URI starts with 'blob'");
21 assert_equals(http.status, 200, "The status is 200");
22 assert_equals(http.statusText, "OK", "The status text is OK when XMLHttpRe quest returns correct blob");
23 assert_equals(http.getResponseHeader("Content-Type"), "image/png", "The co ntent type is image/png when set the respnose blob");
24 this.done();
25 });
26 http.send();
27 });
28 </script>
29
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698