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

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/response-blob-size.html

Issue 183333005: [XHR] Reset m_downloadedBlobLength (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/response-blob-size-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <body> 2 <body>
3 <p>Test Blob.size of response blob received for XMLHttpRequest</p> 3 <script src="../resources/testharness.js"></script>
4 <pre id="console"></pre> 4 <script src="../resources/testharnessreport.js"></script>
5 <script> 5 <script>
6 if (window.testRunner) { 6 var t = async_test("Test Blob.size of response blob received for XMLHttpRequest" );
7 testRunner.dumpAsText(); 7 t.step(function() {
8 testRunner.waitUntilDone(); 8 var req = new XMLHttpRequest;
9 } 9 var i = 0;
10 10 // Run the test multiple times using the same XMLHttpRequest instance to
11 function log(text) 11 // check if all states are cleared correctly.
12 { 12 var doRequest = function() {
13 var console = document.getElementById('console'); 13 req.open('GET', '../resources/test.ogv', true);
14 console.appendChild(document.createTextNode(text + '\n')); 14 req.responseType = 'blob';
15 } 15 req.onreadystatechange = t.step_func(function() {
16 16 if (req.readyState == req.DONE) {
17 function test(expect, actual) 17 assert_equals(200, req.status, "Status");
18 { 18 assert_equals(103746, req.response.size, "Size");
19 log((expect == actual ? 'PASS' : 'FAIL') + ': "' + expect + '" == "' + actua l + '"'); 19 if (++i < 3)
20 } 20 doRequest();
21 21 else
22 var req = new XMLHttpRequest; 22 t.done();
23 req.responseType = 'blob'; 23 }
24 req.open('GET', '../resources/test.ogv', true); 24 });
25 req.onreadystatechange = function() { 25 req.send(null);
26 if (req.readyState == 4) { 26 };
27 test(200, req.status); 27 doRequest();
28 test(103746, req.response.size) 28 });
29 if (window.testRunner)
30 testRunner.notifyDone();
31 }
32 };
33 req.send(null);
34
35 </script> 29 </script>
36 </body> 30 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/response-blob-size-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698