Bug 84941

Summary: [EFL] Implement layoutTestController.dumpResourceResponseMIMETypes
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit EFLAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: gyuyoung.kim, lucas.de.marchi, rakuco, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 81891    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
mrobinson: review+, webkit.review.bot: commit-queue-
Patch for landing none

Description Chris Dumez 2012-04-26 03:40:52 PDT
We need this function to support some tests:

fast/preloader/document-write-noscript.html
fast/preloader/image.html
fast/preloader/input.html
fast/preloader/link.html
fast/preloader/noscript.html
fast/preloader/script.html
fast/preloader/style.html
http/tests/mime/uppercase-mime-type.html
http/tests/loading/preload-append-scan.php
Comment 1 Chris Dumez 2012-04-30 06:17:44 PDT
Created attachment 139438 [details]
Patch

Once implemented, all the tests passed expect one:
 - fast/preloader/script.html (MIME type is "application/javascript" instead of "application/x-javascript")

Mac and chromium ports already have platform-specific expectation to reflect this so I used the same expectation for the EFL port.
Comment 2 Raphael Kubo da Costa (:rakuco) 2012-05-02 20:10:08 PDT
Comment on attachment 139438 [details]
Patch

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

> LayoutTests/ChangeLog:10
> +        is is implemented in EFL port and add EFL expectation for
> +        fast/preloader/script.html.

The explanation for adding a custom expectation you gave in comment #1 would be really helpful here.

> Source/WebKit/efl/ewk/ewk_frame.h:138
> +    const char *mime_type; /**< MIME type of the resource */

This is expected to be a read-only member, right? If so, it makes sense to declare it const char * const.
Comment 3 Chris Dumez 2012-05-02 22:49:11 PDT
Created attachment 139956 [details]
Patch

I have fixed the Changelog.

Note - however - that I did not change the type of mime_type struct member:
- The url member in the same struct cannot be changed either and is "const char *". Unlike the request struct, the response one cannot be changed at all.
- If I change to "const char * const", then this means I need to initialize it as soon as I create the struct (which is a bit inconvenient). The following code wouldn't work anymore:

Ewk_Frame_Resource_Response* redirectResponse;
    Ewk_Frame_Resource_Response responseBuffer;
    CString redirectUrl, mimeType;

    if (coreResponse.isNull())
        redirectResponse = 0;
    else {
        redirectUrl = coreResponse.url().string().utf8();
        mimeType = coreResponse.mimeType().utf8();
        responseBuffer.url = redirectUrl.data();
        responseBuffer.status_code = coreResponse.httpStatusCode();
        responseBuffer.mime_type = mimeType.data();
        redirectResponse = &responseBuffer;
    }

    Ewk_Frame_Resource_Messages messages = { &request, redirectResponse };
Comment 4 Raphael Kubo da Costa (:rakuco) 2012-05-03 08:15:05 PDT
Alright, looks fine then.
Comment 5 WebKit Review Bot 2012-05-04 10:48:16 PDT
Comment on attachment 139956 [details]
Patch

Rejecting attachment 139956 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
ile Source/WebKit/efl/ewk/ewk_frame.h
Hunk #1 FAILED at 135.
1 out of 1 hunk FAILED -- saving rejects to file Source/WebKit/efl/ewk/ewk_frame.h.rej
patching file Tools/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
patching file Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
Hunk #1 succeeded at 592 with fuzz 1 (offset 34 lines).

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Martin Rob..." exit_code: 1 cwd: /mnt/git/webkit-commit-queue/

Full output: http://queues.webkit.org/results/12630197
Comment 6 Chris Dumez 2012-05-04 12:02:54 PDT
Created attachment 140292 [details]
Patch for landing
Comment 7 WebKit Review Bot 2012-05-04 13:14:15 PDT
Comment on attachment 140292 [details]
Patch for landing

Clearing flags on attachment: 140292

Committed r116158: <http://trac.webkit.org/changeset/116158>
Comment 8 WebKit Review Bot 2012-05-04 13:14:19 PDT
All reviewed patches have been landed.  Closing bug.