Bug 92669

Summary: [Qt] load event fires on XMLHttpRequestUpload twice with Qt5
Product: WebKit Reporter: Csaba Osztrogonác <ossy>
Component: Tools / TestsAssignee: Marcelo Lira <marcelo.lira>
Status: RESOLVED FIXED    
Severity: Normal CC: marcelo.lira, ossy, webkit.review.bot
Priority: P2 Keywords: Qt, QtTriaged
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 79666    
Attachments:
Description Flags
Patch
none
Patch none

Description Csaba Osztrogonác 2012-07-30 13:03:41 PDT
Because of this bug there are two failing tests with Qt5 (WK1 and WK2 too):

--- /storage/WebKit/WebKitBuild/Release/layout-test-results/http/tests/xmlhttprequest/upload-onprogress-event-expected.txt
+++ /storage/WebKit/WebKitBuild/Release/layout-test-results/http/tests/xmlhttprequest/upload-onprogress-event-actual.txt
@@ -2,4 +2,6 @@
 
 PASS: onprogress event fired on XMLHttpRequestUpload.
 onprogress: [object XMLHttpRequestProgressEvent] [Loaded: 4 Total: 4]
+PASS: onprogress event fired on XMLHttpRequestUpload.
+onprogress: [object XMLHttpRequestProgressEvent] [Loaded: 0 Total: 0]

--- /storage/WebKit/WebKitBuild/Release/layout-test-results/http/tests/xmlhttprequest/upload-progress-events-expected.txt
+++ /storage/WebKit/WebKitBuild/Release/layout-test-results/http/tests/xmlhttprequest/upload-progress-events-actual.txt
@@ -3,4 +3,5 @@
 PASS: loadstart event fired on XMLHttpRequestUpload: [object XMLHttpRequestProgressEvent]
 PASS: onprogress event fired on XMLHttpRequestUpload: [object XMLHttpRequestProgressEvent] [Loaded: 4 Total: 4]
 PASS: load event fired on XMLHttpRequestUpload: [object XMLHttpRequestProgressEvent]
+PASS: onprogress event fired on XMLHttpRequestUpload: [object XMLHttpRequestProgressEvent] [Loaded: 0 Total: 0]
Comment 1 Csaba Osztrogonác 2012-07-30 13:26:28 PDT
They are on the qt-5.0/Skipped list. Please unskip them with the proper fix.
Comment 2 Marcelo Lira 2012-09-26 11:10:57 PDT
Created attachment 165836 [details]
Patch
Comment 3 Kenneth Rohde Christiansen 2012-09-26 12:28:57 PDT
Comment on attachment 165836 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=165836&action=review

> Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp:586
> +    if (!bytesTotal)
> +        return;

I would add a comment

if (!bytesTotal) {
    // When finished QNetworkReply emits a progress of 0 bytes.
    // Ignore that, to avoid firing twice.
    return;
}
Comment 4 Marcelo Lira 2012-09-26 12:34:53 PDT
Created attachment 165853 [details]
Patch
Comment 5 WebKit Review Bot 2012-09-26 13:10:00 PDT
Comment on attachment 165853 [details]
Patch

Clearing flags on attachment: 165853

Committed r129692: <http://trac.webkit.org/changeset/129692>
Comment 6 WebKit Review Bot 2012-09-26 13:10:03 PDT
All reviewed patches have been landed.  Closing bug.