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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/upload-onload-event.html

Issue 2427553002: Fix XHR's logic to determine whether or not to dispatch upload progress events
Patch Set: a Created 4 years, 2 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
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../resources/testharness.js"></script> 4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script> 5 <script src="../resources/testharnessreport.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <div id="log"></div>
9 <script type="text/javascript"> 8 <script type="text/javascript">
10 9
11 var xhr; 10 var xhr;
12 var payload = "data"; 11 var payload = "data";
13 var expectedLength = payload.length; 12 var expectedLength = payload.length;
14 13
15 function verifyProgressEvent(eventName, e, expected) 14 function verifyProgressEvent(eventName, e, expected)
16 { 15 {
17 assert_true(e.lengthComputable); 16 assert_true(e.lengthComputable);
18 assert_equals(e.loaded, expected, "Expected 'loaded' value of '" + eventName + "' event."); 17 assert_equals(e.loaded, expected, "Expected 'loaded' value of '" + eventName + "' event.");
(...skipping 10 matching lines...) Expand all
29 var testUploadLoadEvent = async_test("Check that upload 'load' events are delive red and have expected values."); 28 var testUploadLoadEvent = async_test("Check that upload 'load' events are delive red and have expected values.");
30 testUploadLoadEvent.step(function () { 29 testUploadLoadEvent.step(function () {
31 xhr = new XMLHttpRequest(); 30 xhr = new XMLHttpRequest();
32 xhr.upload.onload = testUploadLoadEvent.step_func(loadHandler); 31 xhr.upload.onload = testUploadLoadEvent.step_func(loadHandler);
33 xhr.open("POST", "resources/post-echo.php", true); 32 xhr.open("POST", "resources/post-echo.php", true);
34 xhr.send(payload); 33 xhr.send(payload);
35 }); 34 });
36 </script> 35 </script>
37 </body> 36 </body>
38 </html> 37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698