Changeset 66669 in webkit


Ignore:
Timestamp:
Sep 2, 2010 8:29:03 AM (14 years ago)
Author:
caseq@chromium.org
Message:

2010-09-02 Andrey Kosyakov <caseq@chromium.org>

Reviewed by Yury Semikhatsky.

Web Inspector: HAR converter fails on POST requests with non-form content type.
https://bugs.webkit.org/show_bug.cgi?id=45109

  • inspector/front-end/HAREntry.js: (WebInspector.HAREntry.prototype._buildPostData):

2010-09-02 Andrey Kosyakov <caseq@chromium.org>

Reviewed by Yury Semikhatsky.

Web Inspector: HAR converter fails on POST requests with non-form content type.
Migrated HAR tests to inspector-test2.js, enabled resource tracking, added test for XHR POST request.
https://bugs.webkit.org/show_bug.cgi?id=45109

  • http/tests/inspector/resource-har-conversion-expected.txt:
  • http/tests/inspector/resource-har-conversion.html:
  • http/tests/inspector/resource-parameters-expected.txt:
  • http/tests/inspector/resource-test2.js: Added. (initialize_ResourceTest.InspectorTest.resourceURLComparer): (initialize_ResourceTest):
  • platform/chromium-win/http/tests/inspector/resource-parameters-expected.txt:
  • platform/chromium-win/http/tests/inspector/resource-har-conversion-expected.txt: Added.
  • platform/win/http/tests/inspector/console-xhr-logging-expected.txt: Added.
  • platform/win/http/tests/inspector/resource-har-conversion-expected.txt: Added.
  • platform/win/http/tests/inspector/resource-parameters-expected.txt:
Location:
trunk
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r66666 r66669  
     12010-09-02  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: HAR converter fails on POST requests with non-form content type.
     6        Migrated HAR tests to inspector-test2.js, enabled resource tracking, added test for XHR POST request.
     7        https://bugs.webkit.org/show_bug.cgi?id=45109
     8
     9        * http/tests/inspector/resource-har-conversion-expected.txt:
     10        * http/tests/inspector/resource-har-conversion.html:
     11        * http/tests/inspector/resource-parameters-expected.txt:
     12        * http/tests/inspector/resource-test2.js: Added.
     13        (initialize_ResourceTest.InspectorTest.resourceURLComparer):
     14        (initialize_ResourceTest):
     15        * platform/chromium-win/http/tests/inspector/resource-parameters-expected.txt:
     16        * platform/chromium-win/http/tests/inspector/resource-har-conversion-expected.txt: Added.
     17        * platform/win/http/tests/inspector/console-xhr-logging-expected.txt: Added.
     18        * platform/win/http/tests/inspector/resource-har-conversion-expected.txt: Added.
     19        * platform/win/http/tests/inspector/resource-parameters-expected.txt:
     20
    1212010-09-02  Peter Kasting  <pkasting@google.com>
    222
  • trunk/LayoutTests/http/tests/inspector/resource-har-conversion-expected.txt

    r60562 r66669  
    11Tests conversion of Inspector's resource representation into HAR format.
    22
     3Page reloaded.
    34{
    45    0 : {
    56        pageref : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
    6         startedDateTime : <string>
     7        startedDateTime : <object>
     8        time : <number>
     9        request : {
     10            method : "GET"
     11            url : "http://127.0.0.1:8000/inspector/inspector-test2.js"
     12            headers : <object>
     13            headersSize : -1
     14            bodySize : -1
     15        }
     16        response : {
     17            status : 304
     18            statusText : "Not Modified"
     19            headers : <object>
     20            content : {
     21                size : 0
     22                mimeType : "application/x-javascript"
     23            }
     24            redirectURL : ""
     25            headersSize : -1
     26            bodySize : 0
     27        }
     28        timings : {
     29            blocked : -1
     30            dns : -1
     31            connect : -1
     32            send : -1
     33            wait : <number>
     34            receive : <number>
     35            ssl : -1
     36        }
     37    }
     38    1 : {
     39        pageref : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
     40        startedDateTime : <object>
    741        time : <number>
    842        request : {
     
    1852            headers : <object>
    1953            content : {
    20                 size : 778
     54                size : 1137
    2155                mimeType : "text/html"
    2256            }
    2357            redirectURL : ""
    2458            headersSize : -1
    25             bodySize : 778
     59            bodySize : 1137
     60        }
     61        timings : {
     62            blocked : -1
     63            dns : -1
     64            connect : -1
     65            send : -1
     66            wait : <number>
     67            receive : <number>
     68            ssl : -1
     69        }
     70    }
     71    2 : {
     72        pageref : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
     73        startedDateTime : <object>
     74        time : <number>
     75        request : {
     76            method : "GET"
     77            url : "http://127.0.0.1:8000/inspector/resource-test2.js"
     78            headers : <object>
     79            headersSize : -1
     80            bodySize : -1
     81        }
     82        response : {
     83            status : 304
     84            statusText : "Not Modified"
     85            headers : <object>
     86            content : {
     87                size : 0
     88                mimeType : "application/x-javascript"
     89            }
     90            redirectURL : ""
     91            headersSize : -1
     92            bodySize : 0
     93        }
     94        timings : {
     95            blocked : -1
     96            dns : -1
     97            connect : -1
     98            send : -1
     99            wait : <number>
     100            receive : <number>
     101            ssl : -1
     102        }
     103    }
     104    3 : {
     105        pageref : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
     106        startedDateTime : <object>
     107        time : <number>
     108        request : {
     109            method : "POST"
     110            url : "http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html"
     111            headers : <object>
     112            headersSize : -1
     113            bodySize : -1
     114            postData : {
     115                mimeType : "text/xml"
     116                text : "<xml></xml>"
     117            }
     118        }
     119        response : {
     120            status : 404
     121            statusText : "Not Found"
     122            headers : <object>
     123            content : {
     124                size : 355
     125                mimeType : "text/html"
     126            }
     127            redirectURL : ""
     128            headersSize : -1
     129            bodySize : 355
    26130        }
    27131        timings : {
  • trunk/LayoutTests/http/tests/inspector/resource-har-conversion.html

    r60562 r66669  
    11<html>
    22<head>
    3 <script src="inspector-test.js"></script>
    4 <script src="resource-tests.js"></script>
     3<script src="resource-test2.js"></script>
     4<script src="inspector-test2.js"></script>
    55
    66<script>
    7 function doit()
     7
     8var test = function()
    89{
    9     dumpResources();
     10    function getHAR(id)
     11    {
     12        return new WebInspector.HAREntry(WebInspector.resources[id]).build();
     13    }
     14
     15    InspectorTest.enableResourceTracking(function() {
     16        InjectedScriptAccess.getDefault().evaluate("doXHR()", "console", function() {
     17            var resources = Object.keys(WebInspector.resources).map(getHAR).sort(InspectorTest.resourceURLComparer);
     18            InspectorTest.addObject(resources, InspectorTest.HARNondeterministicProperties);
     19            InspectorTest.disableResourceTracking();
     20            InspectorTest.completeTest();
     21        });
     22    });
    1023}
    1124
    12 function dumpResources() {
    13     function callback(result)
    14     {
    15         dumpObject(result.sort(resourceURLComparer), HARNondeterministicProperties);
    16         notifyDone();
    17     }
     25// Make a POST requests to see we handle non-post form data well.
    1826
    19     evaluateInWebInspector("frontend_dumpResources", callback);
     27function doXHR()
     28{
     29    var xhr = new XMLHttpRequest();
     30    xhr.open("POST", "resources/xhr-does-not-exist.html", false);
     31    xhr.setRequestHeader("Content-Type", "text/xml");
     32    xhr.send("<xml></xml>");
    2033}
    2134
    22 // Frontend functions.
     35</script>
    2336
    24 function frontend_dumpResources()
    25 {
    26     var result = [];
    27     for (var resource in WebInspector.resources)
    28         result.push(new WebInspector.HAREntry(WebInspector.resources[resource]).build());
    29     return result;
    30 }
    31 </script>
     37
    3238</head>
    3339
    34 <body onload="onload()">
     40<body onload="runTest()">
    3541<p>
    3642Tests conversion of Inspector's resource representation into HAR format.
  • trunk/LayoutTests/http/tests/inspector/resource-parameters-expected.txt

    r60562 r66669  
    2525        postData : {
    2626            mimeType : "application/x-www-form-urlencoded"
     27            text : "formParam1=formValue1&formParam2="
    2728            params : {
    2829                0 : {
     
    3536                }
    3637            }
    37             text : "formParam1=formValue1&formParam2="
    3838        }
    3939    }
  • trunk/LayoutTests/platform/chromium-win/http/tests/inspector/resource-parameters-expected.txt

    r66215 r66669  
    2525        postData : {
    2626            mimeType : "application/x-www-form-urlencoded"
     27            text : "formParam1=formValue1&formParam2="
    2728            params : {
    2829                0 : {
     
    3536                }
    3637            }
    37             text : "formParam1=formValue1&formParam2="
    3838        }
    3939    }
  • trunk/LayoutTests/platform/win/http/tests/inspector/resource-parameters-expected.txt

    r63791 r66669  
    2525        postData : {
    2626            mimeType : "application/x-www-form-urlencoded"
     27            text : "formParam1=formValue1&formParam2="
    2728            params : {
    2829                0 : {
     
    3536                }
    3637            }
    37             text : "formParam1=formValue1&formParam2="
    3838        }
    3939    }
  • trunk/WebCore/ChangeLog

    r66667 r66669  
     12010-09-02  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: HAR converter fails on POST requests with non-form content type
     6        https://bugs.webkit.org/show_bug.cgi?id=45109
     7
     8        * inspector/front-end/HAREntry.js:
     9        (WebInspector.HAREntry.prototype._buildPostData):
     10
    1112010-09-02  Andreas Kling  <andreas.kling@nokia.com>
    212
  • trunk/WebCore/inspector/front-end/HAREntry.js

    r60562 r66669  
    117117    _buildPostData: function()
    118118    {
    119         return {
     119        var res = {
    120120            mimeType: this._resource.requestHeaderValue("Content-Type"),
    121             params: this._buildParameters(this._resource.formParameters),
    122121            text: this._resource.requestFormData
    123122        };
     123        if (this._resource.formParameters)
     124           res.params = this._buildParameters(this._resource.formParameters);
     125        return res;
    124126    },
    125127
Note: See TracChangeset for help on using the changeset viewer.