Diff
Modified: trunk/LayoutTests/ChangeLog (161890 => 161891)
--- trunk/LayoutTests/ChangeLog 2014-01-13 18:25:43 UTC (rev 161890)
+++ trunk/LayoutTests/ChangeLog 2014-01-13 18:41:17 UTC (rev 161891)
@@ -1,3 +1,23 @@
+2014-01-13 Youenn Fablet <[email protected]>
+
+ Dispatch a progress event before dispatching abort, error or timeout event
+ https://bugs.webkit.org/show_bug.cgi?id=126575
+
+ Reviewed by Alexey Proskuryakov.
+
+ Updated onloadend-event-after-abort.html and onloadend-event-after-error.html to check for progress event.
+ Fixed the other tests to cope with additional progress event.
+
+ * http/tests/xmlhttprequest/onabort-progressevent-attributes.html:
+ * http/tests/xmlhttprequest/onloadend-event-after-abort-expected.txt:
+ * http/tests/xmlhttprequest/onloadend-event-after-abort.html:
+ * http/tests/xmlhttprequest/onloadend-event-after-error-expected.txt:
+ * http/tests/xmlhttprequest/onloadend-event-after-error.html:
+ * http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt:
+ * http/tests/xmlhttprequest/simple-cross-origin-progress-events.html:
+ * http/tests/xmlhttprequest/upload-onloadend-event-after-abort.html:
+ * http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt:
+
2014-01-13 Brent Fulgham <[email protected]>
[WebGL] Error messages should use source code labels, not internal mangled symbols.
Modified: trunk/LayoutTests/http/tests/xmlhttprequest/onabort-progressevent-attributes.html (161890 => 161891)
--- trunk/LayoutTests/http/tests/xmlhttprequest/onabort-progressevent-attributes.html 2014-01-13 18:25:43 UTC (rev 161890)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/onabort-progressevent-attributes.html 2014-01-13 18:41:17 UTC (rev 161891)
@@ -46,12 +46,15 @@
{
var iteration = 2;
var delay = "1000";
-
+ var hasAborted = false;
var req = new XMLHttpRequest();
req._onprogress_ = function(e){
total = e.total;
loaded = e.loaded;
- req.abort();
+ if (!hasAborted) {
+ hasAborted = true;
+ req.abort();
+ }
};
req._onerror_ = onUnexpectedProgressEvent;
req._onabort_ = onProgressEvent;
Modified: trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-abort-expected.txt (161890 => 161891)
--- trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-abort-expected.txt 2014-01-13 18:25:43 UTC (rev 161890)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-abort-expected.txt 2014-01-13 18:41:17 UTC (rev 161891)
@@ -2,6 +2,8 @@
Verify that a loadend ProgressEvent is dispatched after the abort ProgressEvent when an async request is aborted.
+Verify also that a progress ProgressEvent is sent between readystatechange and abort ProgressEvent (bug 126575).
+
PASS should appear below:
PASS
Modified: trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-abort.html (161890 => 161891)
--- trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-abort.html 2014-01-13 18:25:43 UTC (rev 161890)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-abort.html 2014-01-13 18:41:17 UTC (rev 161891)
@@ -5,6 +5,7 @@
<body>
<p>Test case for <a href="" bug 40952</a>: Onloadend event is not supported in XMLHttpRequest</p>
<p>Verify that a loadend ProgressEvent is dispatched after the abort ProgressEvent when an async request is aborted.</p>
+<p> Verify also that a progress ProgressEvent is sent between readystatechange and abort ProgressEvent (<a href="" 126575</a>).</p>
<p>PASS should appear below:</p>
<p id=console></p>
<script type="text/_javascript_">
@@ -21,7 +22,7 @@
var xhr = new XMLHttpRequest();
var results = "";
-var expected = " loadstart readyState=DONE abort loadend";
+var expected = " loadstart readyState=DONE progress abort loadend";
function logProgressEvent(e) {
results += " " + e.type;
@@ -44,8 +45,10 @@
xhr._onreadystatechange_ = function(e) {
if (xhr.readyState == xhr.DONE)
results += " readyState=DONE";
- else if (xhr.readyState > xhr.OPENED)
+ else if (xhr.readyState > xhr.OPENED) {
+ xhr._onprogress_ = logProgressEvent;
xhr.abort();
+ }
}
xhr._onloadstart_ = logProgressEvent;
xhr._onabort_ = logProgressEvent;
Modified: trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-error-expected.txt (161890 => 161891)
--- trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-error-expected.txt 2014-01-13 18:25:43 UTC (rev 161890)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-error-expected.txt 2014-01-13 18:41:17 UTC (rev 161891)
@@ -2,6 +2,8 @@
Verify that a loadend ProgressEvent is dispatched after the error ProgressEvent when an async request fails.
+Verify also that a progress ProgressEvent is sent between readystatechange and error ProgressEvent (bug 126575).
+
PASS should appear below:
PASS
Modified: trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-error.html (161890 => 161891)
--- trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-error.html 2014-01-13 18:25:43 UTC (rev 161890)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-error.html 2014-01-13 18:41:17 UTC (rev 161891)
@@ -5,6 +5,7 @@
<body>
<p> Test case for <a href="" bug 40952</a>: Onloadend event is not supported in XMLHttpRequest</p>
<p> Verify that a loadend ProgressEvent is dispatched after the error ProgressEvent when an async request fails.</p>
+<p> Verify also that a progress ProgressEvent is sent between readystatechange and error ProgressEvent (<a href="" 126575</a>).</p>
<p>PASS should appear below:</p>
<p id=console></p>
<script type="text/_javascript_">
@@ -21,7 +22,7 @@
var xhr = new XMLHttpRequest();
var results = "";
-var expected = " loadstart readyState=DONE error loadend";
+var expected = " loadstart readyState=DONE progress error loadend";
function logProgressEvent(e) {
@@ -43,8 +44,10 @@
function test()
{
xhr._onreadystatechange_ = function(e) {
- if (xhr.readyState == xhr.DONE)
+ if (xhr.readyState == xhr.DONE) {
results += " readyState=DONE";
+ xhr._onprogress_ = logProgressEvent;
+ }
}
xhr._onloadstart_ = logProgressEvent;
xhr._onabort_ = logUnexpectedProgressEvent;
Modified: trunk/LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt (161890 => 161891)
--- trunk/LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt 2014-01-13 18:25:43 UTC (rev 161890)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt 2014-01-13 18:41:17 UTC (rev 161891)
@@ -8,12 +8,15 @@
Response length: 8388608
Test 2: The URL is not allowed for cross-origin requests
+onprogress
onerror (expected)
Response length: 0
Test 3: The URL is not allowed for cross-origin requests and at least one upload event is listened for before doing the send.
upload.onloadstart
+upload.onprogress
upload.onerror (expected)
+onprogress
onerror (expected)
Response length: 0
Modified: trunk/LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events.html (161890 => 161891)
--- trunk/LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events.html 2014-01-13 18:25:43 UTC (rev 161890)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events.html 2014-01-13 18:41:17 UTC (rev 161891)
@@ -27,7 +27,7 @@
function uploadProgress(evt)
{
if (!sawUploadProgress)
- log("FAIL: upload.onprogress");
+ log("upload.onprogress");
sawUploadProgress = true;
}
Modified: trunk/LayoutTests/http/tests/xmlhttprequest/upload-onloadend-event-after-abort.html (161890 => 161891)
--- trunk/LayoutTests/http/tests/xmlhttprequest/upload-onloadend-event-after-abort.html 2014-01-13 18:25:43 UTC (rev 161890)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/upload-onloadend-event-after-abort.html 2014-01-13 18:41:17 UTC (rev 161891)
@@ -42,7 +42,7 @@
function test()
{
xhr.upload._onprogress_ = function(e) {
- logProgressEvent(e);
+ xhr.upload._onprogress_ = logProgressEvent;
xhr.abort();
}
xhr.upload._onabort_ = logProgressEvent;
Modified: trunk/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt (161890 => 161891)
--- trunk/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt 2014-01-13 18:25:43 UTC (rev 161890)
+++ trunk/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt 2014-01-13 18:41:17 UTC (rev 161891)
@@ -10,6 +10,7 @@
Step 2: Cross origin request, disallowed
readystatechange 4
+progress
error
loadend
Error: NETWORK_ERR: XMLHttpRequest Exception 101
Modified: trunk/Source/WebCore/ChangeLog (161890 => 161891)
--- trunk/Source/WebCore/ChangeLog 2014-01-13 18:25:43 UTC (rev 161890)
+++ trunk/Source/WebCore/ChangeLog 2014-01-13 18:41:17 UTC (rev 161891)
@@ -1,3 +1,20 @@
+2014-01-13 Youenn Fablet <[email protected]>
+
+ Dispatch a progress event before dispatching abort, error or timeout event
+ https://bugs.webkit.org/show_bug.cgi?id=126575
+
+ Reviewed by Alexey Proskuryakov.
+
+ Added sending of progress event after readystatechange event (switching to DONE state) in case of abort, error or timeout.
+ Fixed assertions in XMLHttpRequestProgressEventThrottle and XMLHttpRequestUpload.
+
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::dispatchErrorEvents): added sending of progress event before the specific error event
+ * xml/XMLHttpRequestProgressEventThrottle.cpp:
+ (WebCore::XMLHttpRequestProgressEventThrottle::dispatchProgressEvent): fixed assertion
+ * xml/XMLHttpRequestUpload.cpp:
+ (WebCore::XMLHttpRequestUpload::dispatchProgressEvent): fixed assertion
+
2014-01-13 Carlos Garcia Campos <[email protected]>
[SOUP] Add SoupNetworkSession class to wrap a SoupSession
Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (161890 => 161891)
--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp 2014-01-13 18:25:43 UTC (rev 161890)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp 2014-01-13 18:41:17 UTC (rev 161891)
@@ -1245,10 +1245,12 @@
if (!m_uploadComplete) {
m_uploadComplete = true;
if (m_upload && m_uploadEventsAllowed) {
+ m_upload->dispatchProgressEvent(eventNames().progressEvent);
m_upload->dispatchProgressEvent(type);
m_upload->dispatchProgressEvent(eventNames().loadendEvent);
}
}
+ m_progressEventThrottle.dispatchProgressEvent(eventNames().progressEvent);
m_progressEventThrottle.dispatchProgressEvent(type);
m_progressEventThrottle.dispatchProgressEvent(eventNames().loadendEvent);
}
Modified: trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp (161890 => 161891)
--- trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp 2014-01-13 18:25:43 UTC (rev 161890)
+++ trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp 2014-01-13 18:41:17 UTC (rev 161891)
@@ -102,7 +102,7 @@
void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(const AtomicString &type)
{
- ASSERT(type == eventNames().loadEvent || type == eventNames().loadendEvent || type == eventNames().loadstartEvent || type == eventNames().abortEvent || type == eventNames().errorEvent || type == eventNames().timeoutEvent);
+ ASSERT(type == type == eventNames().loadstartEvent || type == eventNames().progressEvent || eventNames().loadEvent || type == eventNames().loadendEvent || type == eventNames().abortEvent || type == eventNames().errorEvent || type == eventNames().timeoutEvent);
if (type == eventNames().loadstartEvent) {
m_lengthComputable = false;
Modified: trunk/Source/WebCore/xml/XMLHttpRequestUpload.cpp (161890 => 161891)
--- trunk/Source/WebCore/xml/XMLHttpRequestUpload.cpp 2014-01-13 18:25:43 UTC (rev 161890)
+++ trunk/Source/WebCore/xml/XMLHttpRequestUpload.cpp 2014-01-13 18:41:17 UTC (rev 161891)
@@ -53,7 +53,7 @@
void XMLHttpRequestUpload::dispatchProgressEvent(const AtomicString &type)
{
- ASSERT(type == eventNames().loadEvent || type == eventNames().loadendEvent || type == eventNames().loadstartEvent || type == eventNames().abortEvent || type == eventNames().errorEvent || type == eventNames().timeoutEvent);
+ ASSERT(type == eventNames().loadstartEvent || type == eventNames().progressEvent || type == eventNames().loadEvent || type == eventNames().loadendEvent || type == eventNames().abortEvent || type == eventNames().errorEvent || type == eventNames().timeoutEvent);
if (type == eventNames().loadstartEvent) {
m_lengthComputable = false;