Changeset 83275 in webkit


Ignore:
Timestamp:
Apr 8, 2011 2:48:46 AM (13 years ago)
Author:
caseq@chromium.org
Message:

2011-04-08 Andrey Kosyakov <caseq@chromium.org>

Reviewed by Yury Semikhatsky.

Web Inspector: HAR compliance fixes
https://bugs.webkit.org/show_bug.cgi?id=58124

  • Always provide some values for queryString and cookies, even though arrays may be empty
  • Always provide an empty cache object
  • Added entire HARLog to test
  • Workaround in test to avoid custom expectations (favicon.ico appears in log on certain platforms)

2011-04-08 Andrey Kosyakov <caseq@chromium.org>

Reviewed by Yury Semikhatsky.

Web Inspector: HAR compliance fixes
https://bugs.webkit.org/show_bug.cgi?id=58124

  • Added entire HARLog to test
  • Workaround in test to avoid custom expectations (favicon.ico appears in log on certain platforms
  • http/tests/inspector/resource-har-conversion-expected.txt:
  • http/tests/inspector/resource-har-conversion.html:
  • http/tests/inspector/resources-test.js:
  • platform/mac-wk2/http/tests/inspector/resource-har-conversion-expected.txt: Removed.
Location:
trunk
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r83273 r83275  
     12011-04-08  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: HAR compliance fixes
     6        https://bugs.webkit.org/show_bug.cgi?id=58124
     7
     8        - Added entire HARLog to test
     9        - Workaround in test to avoid custom expectations (favicon.ico appears in log on certain platforms
     10
     11        * http/tests/inspector/resource-har-conversion-expected.txt:
     12        * http/tests/inspector/resource-har-conversion.html:
     13        * http/tests/inspector/resources-test.js:
     14        * platform/mac-wk2/http/tests/inspector/resource-har-conversion-expected.txt: Removed.
     15
    1162011-04-08  Sergio Villar Senin  <svillar@igalia.com>
    217
  • trunk/LayoutTests/http/tests/inspector/resource-har-conversion-expected.txt

    r78535 r83275  
    33Page reloaded.
    44{
    5     0 : {
    6         pageref : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
    7         startedDateTime : <object>
    8         time : <number>
    9         request : {
    10             method : "GET"
    11             url : "http://127.0.0.1:8000/inspector/inspector-test.js"
    12             headers : <object>
    13             headersSize : -1
    14             bodySize : <number>
    15             cookies : {
    16                 0 : {
    17                     name : "a"
    18                     value : "b"
    19                     path : "/path"
    20                     domain : "example.com"
    21                     expires : null
    22                     httpOnly : false
    23                     secure : false
    24                 }
    25                 1 : {
    26                     name : "a1"
    27                     value : "b1"
    28                     path : undefined
    29                     domain : undefined
    30                     expires : null
    31                     httpOnly : false
    32                     secure : false
    33                 }
    34                 2 : {
    35                     name : "c1"
    36                     value : "d1"
    37                     path : undefined
    38                     domain : undefined
    39                     expires : null
    40                     httpOnly : false
    41                     secure : false
     5    version : <string>
     6    creator : {
     7        name : "WebInspector"
     8        version : <string>
     9    }
     10    pages : {
     11        0 : {
     12            startedDateTime : <object>
     13            id : <string>
     14            title : ""
     15            pageTimings : {
     16                onContentLoad : <number>
     17                onLoad : <number>
     18            }
     19        }
     20    }
     21    entries : {
     22        0 : {
     23            pageref : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
     24            startedDateTime : <object>
     25            time : <number>
     26            request : {
     27                method : "GET"
     28                url : "http://127.0.0.1:8000/inspector/inspector-test.js"
     29                headers : <object>
     30                headersSize : -1
     31                bodySize : <number>
     32                cookies : {
     33                    0 : {
     34                        name : "a"
     35                        value : "b"
     36                        path : "/path"
     37                        domain : "example.com"
     38                        expires : null
     39                        httpOnly : false
     40                        secure : false
     41                    }
     42                    1 : {
     43                        name : "a1"
     44                        value : "b1"
     45                        path : undefined
     46                        domain : undefined
     47                        expires : null
     48                        httpOnly : false
     49                        secure : false
     50                    }
     51                    2 : {
     52                        name : "c1"
     53                        value : "d1"
     54                        path : undefined
     55                        domain : undefined
     56                        expires : null
     57                        httpOnly : false
     58                        secure : false
     59                    }
    4260                }
    4361            }
    44         }
    45         response : {
    46             status : 304
    47             statusText : "Not Modified"
    48             headers : <object>
    49             content : {
    50                 size : <number>
    51                 mimeType : "application/x-javascript"
    52             }
    53             redirectURL : ""
    54             headersSize : -1
    55             bodySize : <number>
    56             cookies : {
    57                 0 : {
    58                     name : "x"
    59                     value : "y"
    60                     path : "/path"
    61                     domain : "example.com"
    62                     expires : null
    63                     httpOnly : true
    64                     secure : true
     62            response : {
     63                status : 304
     64                statusText : "Not Modified"
     65                headers : <object>
     66                content : {
     67                    size : <number>
     68                    mimeType : "application/x-javascript"
    6569                }
    66                 1 : {
    67                     name : "x1"
    68                     value : "y1"
    69                     path : undefined
    70                     domain : undefined
    71                     expires : null
    72                     httpOnly : false
    73                     secure : false
    74                 }
    75                 2 : {
    76                     name : "z2"
    77                     value : "y2"
    78                     path : undefined
    79                     domain : undefined
    80                     expires : null
    81                     httpOnly : false
    82                     secure : false
     70                redirectURL : ""
     71                headersSize : -1
     72                bodySize : <number>
     73                cookies : {
     74                    0 : {
     75                        name : "x"
     76                        value : "y"
     77                        path : "/path"
     78                        domain : "example.com"
     79                        expires : null
     80                        httpOnly : true
     81                        secure : true
     82                    }
     83                    1 : {
     84                        name : "x1"
     85                        value : "y1"
     86                        path : undefined
     87                        domain : undefined
     88                        expires : null
     89                        httpOnly : false
     90                        secure : false
     91                    }
     92                    2 : {
     93                        name : "z2"
     94                        value : "y2"
     95                        path : undefined
     96                        domain : undefined
     97                        expires : null
     98                        httpOnly : false
     99                        secure : false
     100                    }
    83101                }
    84102            }
     103            timings : <object>
    85104        }
    86         timings : <object>
    87     }
    88     1 : {
    89         pageref : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
    90         startedDateTime : <object>
    91         time : <number>
    92         request : {
    93             method : "GET"
    94             url : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
    95             headers : <object>
    96             headersSize : -1
    97             bodySize : <number>
     105        1 : {
     106            pageref : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
     107            startedDateTime : <object>
     108            time : <number>
     109            request : {
     110                method : "GET"
     111                url : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
     112                headers : <object>
     113                headersSize : -1
     114                bodySize : <number>
     115            }
     116            response : {
     117                status : 200
     118                statusText : "OK"
     119                headers : <object>
     120                content : {
     121                    size : <number>
     122                    mimeType : "text/html"
     123                }
     124                redirectURL : ""
     125                headersSize : -1
     126                bodySize : <number>
     127            }
     128            timings : <object>
    98129        }
    99         response : {
    100             status : 200
    101             statusText : "OK"
    102             headers : <object>
    103             content : {
    104                 size : <number>
    105                 mimeType : "text/html"
     130        2 : {
     131            pageref : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
     132            startedDateTime : <object>
     133            time : <number>
     134            request : {
     135                method : "GET"
     136                url : "http://127.0.0.1:8000/inspector/resources-test.js"
     137                headers : <object>
     138                headersSize : -1
     139                bodySize : <number>
    106140            }
    107             redirectURL : ""
    108             headersSize : -1
    109             bodySize : <number>
     141            response : {
     142                status : 304
     143                statusText : "Not Modified"
     144                headers : <object>
     145                content : {
     146                    size : <number>
     147                    mimeType : "application/x-javascript"
     148                }
     149                redirectURL : ""
     150                headersSize : -1
     151                bodySize : <number>
     152            }
     153            timings : <object>
    110154        }
    111         timings : <object>
    112     }
    113     2 : {
    114         pageref : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
    115         startedDateTime : <object>
    116         time : <number>
    117         request : {
    118             method : "GET"
    119             url : "http://127.0.0.1:8000/inspector/resources-test.js"
    120             headers : <object>
    121             headersSize : -1
    122             bodySize : <number>
     155        3 : {
     156            pageref : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
     157            startedDateTime : <object>
     158            time : <number>
     159            request : {
     160                method : "POST"
     161                url : "http://127.0.0.1:8000/inspector/resources/post-target.cgi"
     162                headers : <object>
     163                headersSize : -1
     164                bodySize : <number>
     165                postData : {
     166                    mimeType : "text/xml"
     167                    text : "<xml></xml>"
     168                }
     169            }
     170            response : {
     171                status : 200
     172                statusText : "OK"
     173                headers : <object>
     174                content : {
     175                    size : <number>
     176                    mimeType : "application/xml"
     177                }
     178                redirectURL : ""
     179                headersSize : -1
     180                bodySize : <number>
     181            }
     182            timings : <object>
    123183        }
    124         response : {
    125             status : 304
    126             statusText : "Not Modified"
    127             headers : <object>
    128             content : {
    129                 size : <number>
    130                 mimeType : "application/x-javascript"
    131             }
    132             redirectURL : ""
    133             headersSize : -1
    134             bodySize : <number>
    135         }
    136         timings : <object>
    137     }
    138     3 : {
    139         pageref : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
    140         startedDateTime : <object>
    141         time : <number>
    142         request : {
    143             method : "POST"
    144             url : "http://127.0.0.1:8000/inspector/resources/post-target.cgi"
    145             headers : <object>
    146             headersSize : -1
    147             bodySize : <number>
    148             postData : {
    149                 mimeType : "text/xml"
    150                 text : "<xml></xml>"
    151             }
    152         }
    153         response : {
    154             status : 200
    155             statusText : "OK"
    156             headers : <object>
    157             content : {
    158                 size : <number>
    159                 mimeType : "application/xml"
    160             }
    161             redirectURL : ""
    162             headersSize : -1
    163             bodySize : <number>
    164         }
    165         timings : <object>
    166184    }
    167185}
  • trunk/LayoutTests/http/tests/inspector/resource-har-conversion.html

    r78535 r83275  
    4444
    4545        addCookieHeadersToResource(findResourceByURL(/inspector-test\.js$/));
    46         var entries = (new WebInspector.HARLog()).build().entries;
    47         entries.sort(InspectorTest.resourceURLComparer);
    48         InspectorTest.addObject(entries, InspectorTest.HARNondeterministicPropertiesWithSize);
     46        var log = (new WebInspector.HARLog()).build();
     47        // Filter out favicon.ico requests that only appear on certain platforms.
     48        log.entries = log.entries.filter(function(entry) {
     49            return !/favicon\.ico$/.test(entry.request.url);
     50        });
     51        log.entries.sort(InspectorTest.resourceURLComparer);
     52        InspectorTest.addObject(log, InspectorTest.HARNondeterministicPropertiesWithSize);
     53        var pageTimings = log.pages[0].pageTimings;
    4954        InspectorTest.completeTest();
    5055    }
  • trunk/LayoutTests/http/tests/inspector/resources-test.js

    r82713 r83275  
    88    headers: 1,
    99    timings: 1,
     10    version: 1,
     11    startedDateTime: 1,
     12    id: 1,
     13    onContentLoad: 1,
     14    onLoad: 1
    1015};
    1116
  • trunk/Source/WebCore/ChangeLog

    r83264 r83275  
     12011-04-08  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: HAR compliance fixes
     6        https://bugs.webkit.org/show_bug.cgi?id=58124
     7
     8        - Always provide some values for queryString and cookies, even though arrays may be empty
     9        - Always provide an empty cache object
     10        - Added entire HARLog to test
     11        - Workaround in test to avoid custom expectations (favicon.ico appears in log on certain platforms)
     12
     13        * inspector/front-end/HAREntry.js:
     14        (WebInspector.HAREntry.prototype.build):
     15        (WebInspector.HAREntry.prototype._buildRequest):
     16        (WebInspector.HAREntry.prototype._buildResponse):
     17
    1182011-04-08  Adam Barth  <abarth@webkit.org>
    219
  • trunk/Source/WebCore/inspector/front-end/HAREntry.js

    r80355 r83275  
    3232// for HAR specification.
    3333
     34// FIXME: Some fields are not yet supported due to back-end limitations.
     35// See https://bugs.webkit.org/show_bug.cgi?id=58127 for details.
     36
    3437WebInspector.HAREntry = function(resource)
    3538{
     
    4649            request: this._buildRequest(),
    4750            response: this._buildResponse(),
    48             // cache: {...}, -- Not supproted yet.
     51            cache: { }, // Not supproted yet.
    4952            timings: this._buildTimings()
    5053        };
     
    5861            // httpVersion: "HTTP/1.1" -- Not available.
    5962            headers: this._buildHeaders(this._resource.requestHeaders),
     63            queryString: this._buildParameters(this._resource.queryParameters || []),
     64            cookies: this._buildCookies(this._resource.requestCookies || []),
    6065            headersSize: -1, // Not available.
    6166            bodySize: -1 // Not available.
    6267        };
    63         if (this._resource.queryParameters)
    64             res.queryString = this._buildParameters(this._resource.queryParameters);
    6568        if (this._resource.requestFormData)
    6669            res.postData = this._buildPostData();
    67         if (this._resource.requestCookies)
    68             res.cookies = this._buildCookies(this._resource.requestCookies);
    6970        return res;
    7071    },
     
    7273    _buildResponse: function()
    7374    {
    74         var res = {
     75        return {
    7576            status: this._resource.statusCode,
    7677            statusText: this._resource.statusText,
    7778            // "httpVersion": "HTTP/1.1" -- Not available.
    7879            headers: this._buildHeaders(this._resource.responseHeaders),
     80            cookies: this._buildCookies(this._resource.responseCookies || []),
    7981            content: this._buildContent(),
    8082            redirectURL: this._resource.responseHeaderValue("Location") || "",
     
    8284            bodySize: this._resource.resourceSize
    8385        };
    84         if (this._resource.responseCookies)
    85             res.cookies = this._buildCookies(this._resource.responseCookies);
    86         return res;
    8786    },
    8887
Note: See TracChangeset for help on using the changeset viewer.