Changeset 161891 in webkit
- Timestamp:
- Jan 13, 2014 10:41:17 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r161889 r161891 1 2014-01-13 Youenn Fablet <youennf@gmail.com> 2 3 Dispatch a progress event before dispatching abort, error or timeout event 4 https://bugs.webkit.org/show_bug.cgi?id=126575 5 6 Reviewed by Alexey Proskuryakov. 7 8 Updated onloadend-event-after-abort.html and onloadend-event-after-error.html to check for progress event. 9 Fixed the other tests to cope with additional progress event. 10 11 * http/tests/xmlhttprequest/onabort-progressevent-attributes.html: 12 * http/tests/xmlhttprequest/onloadend-event-after-abort-expected.txt: 13 * http/tests/xmlhttprequest/onloadend-event-after-abort.html: 14 * http/tests/xmlhttprequest/onloadend-event-after-error-expected.txt: 15 * http/tests/xmlhttprequest/onloadend-event-after-error.html: 16 * http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt: 17 * http/tests/xmlhttprequest/simple-cross-origin-progress-events.html: 18 * http/tests/xmlhttprequest/upload-onloadend-event-after-abort.html: 19 * http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt: 20 1 21 2014-01-13 Brent Fulgham <bfulgham@apple.com> 2 22 -
trunk/LayoutTests/http/tests/xmlhttprequest/onabort-progressevent-attributes.html
r161668 r161891 47 47 var iteration = 2; 48 48 var delay = "1000"; 49 49 var hasAborted = false; 50 50 var req = new XMLHttpRequest(); 51 51 req.onprogress = function(e){ 52 52 total = e.total; 53 53 loaded = e.loaded; 54 req.abort(); 54 if (!hasAborted) { 55 hasAborted = true; 56 req.abort(); 57 } 55 58 }; 56 59 req.onerror = onUnexpectedProgressEvent; -
trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-abort-expected.txt
r103502 r161891 3 3 Verify that a loadend ProgressEvent is dispatched after the abort ProgressEvent when an async request is aborted. 4 4 5 Verify also that a progress ProgressEvent is sent between readystatechange and abort ProgressEvent (bug 126575). 6 5 7 PASS should appear below: 6 8 -
trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-abort.html
r120167 r161891 6 6 <p>Test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=40952"> bug 40952</a>: Onloadend event is not supported in XMLHttpRequest</p> 7 7 <p>Verify that a loadend ProgressEvent is dispatched after the abort ProgressEvent when an async request is aborted.</p> 8 <p> Verify also that a progress ProgressEvent is sent between readystatechange and abort ProgressEvent (<a href="https://bugs.webkit.org/show_bug.cgi?id=126575">bug 126575</a>).</p> 8 9 <p>PASS should appear below:</p> 9 10 <p id=console></p> … … 22 23 var xhr = new XMLHttpRequest(); 23 24 var results = ""; 24 var expected = " loadstart readyState=DONE abort loadend";25 var expected = " loadstart readyState=DONE progress abort loadend"; 25 26 26 27 function logProgressEvent(e) { … … 45 46 if (xhr.readyState == xhr.DONE) 46 47 results += " readyState=DONE"; 47 else if (xhr.readyState > xhr.OPENED) 48 else if (xhr.readyState > xhr.OPENED) { 49 xhr.onprogress = logProgressEvent; 48 50 xhr.abort(); 51 } 49 52 } 50 53 xhr.onloadstart = logProgressEvent; -
trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-error-expected.txt
r103502 r161891 3 3 Verify that a loadend ProgressEvent is dispatched after the error ProgressEvent when an async request fails. 4 4 5 Verify also that a progress ProgressEvent is sent between readystatechange and error ProgressEvent (bug 126575). 6 5 7 PASS should appear below: 6 8 -
trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-error.html
r120167 r161891 6 6 <p> Test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=40952"> bug 40952</a>: Onloadend event is not supported in XMLHttpRequest</p> 7 7 <p> Verify that a loadend ProgressEvent is dispatched after the error ProgressEvent when an async request fails.</p> 8 <p> Verify also that a progress ProgressEvent is sent between readystatechange and error ProgressEvent (<a href="https://bugs.webkit.org/show_bug.cgi?id=126575">bug 126575</a>).</p> 8 9 <p>PASS should appear below:</p> 9 10 <p id=console></p> … … 22 23 var xhr = new XMLHttpRequest(); 23 24 var results = ""; 24 var expected = " loadstart readyState=DONE error loadend";25 var expected = " loadstart readyState=DONE progress error loadend"; 25 26 26 27 … … 44 45 { 45 46 xhr.onreadystatechange = function(e) { 46 if (xhr.readyState == xhr.DONE) 47 if (xhr.readyState == xhr.DONE) { 47 48 results += " readyState=DONE"; 49 xhr.onprogress = logProgressEvent; 50 } 48 51 } 49 52 xhr.onloadstart = logProgressEvent; -
trunk/LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt
r154004 r161891 9 9 10 10 Test 2: The URL is not allowed for cross-origin requests 11 onprogress 11 12 onerror (expected) 12 13 Response length: 0 … … 14 15 Test 3: The URL is not allowed for cross-origin requests and at least one upload event is listened for before doing the send. 15 16 upload.onloadstart 17 upload.onprogress 16 18 upload.onerror (expected) 19 onprogress 17 20 onerror (expected) 18 21 Response length: 0 -
trunk/LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events.html
r154004 r161891 28 28 { 29 29 if (!sawUploadProgress) 30 log(" FAIL:upload.onprogress");30 log("upload.onprogress"); 31 31 sawUploadProgress = true; 32 32 } -
trunk/LayoutTests/http/tests/xmlhttprequest/upload-onloadend-event-after-abort.html
r120167 r161891 43 43 { 44 44 xhr.upload.onprogress = function(e) { 45 logProgressEvent(e);45 xhr.upload.onprogress = logProgressEvent; 46 46 xhr.abort(); 47 47 } -
trunk/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt
r104803 r161891 11 11 Step 2: Cross origin request, disallowed 12 12 readystatechange 4 13 progress 13 14 error 14 15 loadend -
trunk/Source/WebCore/ChangeLog
r161890 r161891 1 2014-01-13 Youenn Fablet <youennf@gmail.com> 2 3 Dispatch a progress event before dispatching abort, error or timeout event 4 https://bugs.webkit.org/show_bug.cgi?id=126575 5 6 Reviewed by Alexey Proskuryakov. 7 8 Added sending of progress event after readystatechange event (switching to DONE state) in case of abort, error or timeout. 9 Fixed assertions in XMLHttpRequestProgressEventThrottle and XMLHttpRequestUpload. 10 11 * xml/XMLHttpRequest.cpp: 12 (WebCore::XMLHttpRequest::dispatchErrorEvents): added sending of progress event before the specific error event 13 * xml/XMLHttpRequestProgressEventThrottle.cpp: 14 (WebCore::XMLHttpRequestProgressEventThrottle::dispatchProgressEvent): fixed assertion 15 * xml/XMLHttpRequestUpload.cpp: 16 (WebCore::XMLHttpRequestUpload::dispatchProgressEvent): fixed assertion 17 1 18 2014-01-13 Carlos Garcia Campos <cgarcia@igalia.com> 2 19 -
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
r161851 r161891 1246 1246 m_uploadComplete = true; 1247 1247 if (m_upload && m_uploadEventsAllowed) { 1248 m_upload->dispatchProgressEvent(eventNames().progressEvent); 1248 1249 m_upload->dispatchProgressEvent(type); 1249 1250 m_upload->dispatchProgressEvent(eventNames().loadendEvent); 1250 1251 } 1251 1252 } 1253 m_progressEventThrottle.dispatchProgressEvent(eventNames().progressEvent); 1252 1254 m_progressEventThrottle.dispatchProgressEvent(type); 1253 1255 m_progressEventThrottle.dispatchProgressEvent(eventNames().loadendEvent); -
trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp
r161668 r161891 103 103 void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(const AtomicString &type) 104 104 { 105 ASSERT(type == eventNames().loadEvent || type == eventNames().loadendEvent || type == eventNames().loadstartEvent || type == eventNames().abortEvent || type == eventNames().errorEvent || type == eventNames().timeoutEvent);105 ASSERT(type == type == eventNames().loadstartEvent || type == eventNames().progressEvent || eventNames().loadEvent || type == eventNames().loadendEvent || type == eventNames().abortEvent || type == eventNames().errorEvent || type == eventNames().timeoutEvent); 106 106 107 107 if (type == eventNames().loadstartEvent) { -
trunk/Source/WebCore/xml/XMLHttpRequestUpload.cpp
r161668 r161891 54 54 void XMLHttpRequestUpload::dispatchProgressEvent(const AtomicString &type) 55 55 { 56 ASSERT(type == eventNames().load Event || type == eventNames().loadendEvent || type == eventNames().loadstartEvent || type == eventNames().abortEvent || type == eventNames().errorEvent || type == eventNames().timeoutEvent);56 ASSERT(type == eventNames().loadstartEvent || type == eventNames().progressEvent || type == eventNames().loadEvent || type == eventNames().loadendEvent || type == eventNames().abortEvent || type == eventNames().errorEvent || type == eventNames().timeoutEvent); 57 57 58 58 if (type == eventNames().loadstartEvent) {
Note: See TracChangeset
for help on using the changeset viewer.