Bug 84941 - [EFL] Implement layoutTestController.dumpResourceResponseMIMETypes
Summary: [EFL] Implement layoutTestController.dumpResourceResponseMIMETypes
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
Depends on: 81891
  Show dependency treegraph
Reported: 2012-04-26 03:40 PDT by Chris Dumez
Modified: 2012-05-04 13:14 PDT (History)
4 users (show)

See Also:

Patch (6.35 KB, patch)
2012-04-30 06:17 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.42 KB, patch)
2012-05-02 22:49 PDT, Chris Dumez
mrobinson: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (6.56 KB, patch)
2012-05-04 12:02 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2012-04-26 03:40:52 PDT
We need this function to support some tests:

Comment 1 Chris Dumez 2012-04-30 06:17:44 PDT
Created attachment 139438 [details]

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]

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]

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]

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.