Diff
Modified: trunk/LayoutTests/ChangeLog (87072 => 87073)
--- trunk/LayoutTests/ChangeLog 2011-05-23 14:20:30 UTC (rev 87072)
+++ trunk/LayoutTests/ChangeLog 2011-05-23 14:30:47 UTC (rev 87073)
@@ -1,3 +1,20 @@
+2011-05-23 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r87070.
+ http://trac.webkit.org/changeset/87070
+ https://bugs.webkit.org/show_bug.cgi?id=61285
+
+ broke resource-parameters.html on win, weird failures on wk2
+ (Requested by caseq on #webkit).
+
+ * http/tests/inspector/network/network-size.html:
+ * http/tests/inspector/resource-har-conversion-expected.txt:
+ * http/tests/inspector/resource-har-conversion.html:
+ * http/tests/inspector/resource-har-headers-expected.txt: Removed.
+ * http/tests/inspector/resource-har-headers.html: Removed.
+ * http/tests/inspector/resource-parameters-expected.txt:
+ * http/tests/inspector/resources-test.js:
+
2011-05-23 Qi Zhang <[email protected]>
Reviewed by Darin Adler.
Modified: trunk/LayoutTests/http/tests/inspector/network/network-size.html (87072 => 87073)
--- trunk/LayoutTests/http/tests/inspector/network/network-size.html 2011-05-23 14:20:30 UTC (rev 87072)
+++ trunk/LayoutTests/http/tests/inspector/network/network-size.html 2011-05-23 14:30:47 UTC (rev 87073)
@@ -36,12 +36,12 @@
var resource1 = WebInspector.panels.network.resources[resourcesCount - 2];
InspectorTest.addResult(resource1.url);
InspectorTest.addResult("resourceSize: " + resource1.resourceSize);
- InspectorTest.addResult("transferSize: " + (resource1.transferSize - resource1.responseHeadersSize));
+ InspectorTest.addResult("transferSize: " + (resource1.transferSize - resource1._responseHeadersSize));
var resource2 = WebInspector.panels.network.resources[resourcesCount - 1];
InspectorTest.addResult(resource2.url);
InspectorTest.addResult("resourceSize: " + resource2.resourceSize);
- InspectorTest.addResult("transferSize: " + (resource2.transferSize - resource2.responseHeadersSize));
+ InspectorTest.addResult("transferSize: " + (resource2.transferSize - resource2._responseHeadersSize));
InspectorTest.completeTest();
}
Modified: trunk/LayoutTests/http/tests/inspector/resource-har-conversion-expected.txt (87072 => 87073)
--- trunk/LayoutTests/http/tests/inspector/resource-har-conversion-expected.txt 2011-05-23 14:20:30 UTC (rev 87072)
+++ trunk/LayoutTests/http/tests/inspector/resource-har-conversion-expected.txt 2011-05-23 14:30:47 UTC (rev 87073)
@@ -26,7 +26,6 @@
request : {
method : "GET"
url : "http://127.0.0.1:8000/inspector/inspector-test.js"
- httpVersion : "HTTP/1.1"
headers : <object>
queryString : [
]
@@ -59,13 +58,12 @@
secure : false
}
]
- headersSize : <number>
+ headersSize : -1
bodySize : <number>
}
response : {
status : 304
statusText : "Not Modified"
- httpVersion : "HTTP/1.1"
headers : <object>
cookies : [
{
@@ -98,11 +96,10 @@
]
content : {
size : <number>
- compression : <number>
mimeType : "application/x-_javascript_"
}
redirectURL : ""
- headersSize : <number>
+ headersSize : -1
bodySize : <number>
}
cache : {
@@ -116,29 +113,26 @@
request : {
method : "GET"
url : "http://127.0.0.1:8000/inspector/resource-har-conversion.html"
- httpVersion : "HTTP/1.1"
headers : <object>
queryString : [
]
cookies : [
]
- headersSize : <number>
+ headersSize : -1
bodySize : <number>
}
response : {
status : 200
statusText : "OK"
- httpVersion : "HTTP/1.1"
headers : <object>
cookies : [
]
content : {
size : <number>
- compression : <number>
mimeType : "text/html"
}
redirectURL : ""
- headersSize : <number>
+ headersSize : -1
bodySize : <number>
}
cache : {
@@ -152,29 +146,26 @@
request : {
method : "GET"
url : "http://127.0.0.1:8000/inspector/resources-test.js"
- httpVersion : "HTTP/1.1"
headers : <object>
queryString : [
]
cookies : [
]
- headersSize : <number>
+ headersSize : -1
bodySize : <number>
}
response : {
status : 304
statusText : "Not Modified"
- httpVersion : "HTTP/1.1"
headers : <object>
cookies : [
]
content : {
size : <number>
- compression : <number>
mimeType : "application/x-_javascript_"
}
redirectURL : ""
- headersSize : <number>
+ headersSize : -1
bodySize : <number>
}
cache : {
@@ -188,13 +179,12 @@
request : {
method : "POST"
url : "http://127.0.0.1:8000/inspector/resources/post-target.cgi"
- httpVersion : "HTTP/1.1"
headers : <object>
queryString : [
]
cookies : [
]
- headersSize : <number>
+ headersSize : -1
bodySize : <number>
postData : {
mimeType : "text/xml"
@@ -204,17 +194,15 @@
response : {
status : 200
statusText : "OK"
- httpVersion : "HTTP/1.1"
headers : <object>
cookies : [
]
content : {
size : <number>
- compression : <number>
mimeType : "application/xml"
}
redirectURL : ""
- headersSize : <number>
+ headersSize : -1
bodySize : <number>
}
cache : {
Modified: trunk/LayoutTests/http/tests/inspector/resource-har-conversion.html (87072 => 87073)
--- trunk/LayoutTests/http/tests/inspector/resource-har-conversion.html 2011-05-23 14:20:30 UTC (rev 87072)
+++ trunk/LayoutTests/http/tests/inspector/resource-har-conversion.html 2011-05-23 14:30:47 UTC (rev 87073)
@@ -1,4 +1,3 @@
-<!doctype html>
<html>
<head>
<script src=""
@@ -38,7 +37,6 @@
resource.requestHeaders = {
"Cookie": "a=b; $Path=/path; $Domain=example.com; a1=b1\nc1=d1"
};
-
resource.responseHeaders = {
"Set-Cookie": "x=y; Path=/path; Domain=example.com; Discard; httpOnly; Secure; Version=1\nx1=y1\nz2=y2"
};
Deleted: trunk/LayoutTests/http/tests/inspector/resource-har-headers-expected.txt (87072 => 87073)
--- trunk/LayoutTests/http/tests/inspector/resource-har-headers-expected.txt 2011-05-23 14:20:30 UTC (rev 87072)
+++ trunk/LayoutTests/http/tests/inspector/resource-har-headers-expected.txt 2011-05-23 14:30:47 UTC (rev 87073)
@@ -1,67 +0,0 @@
-Tests the nondeterministic bits of HAR conversion via the magic of hard-coded values.
-
-Resource:{
- request : {
- headers : {
- Request : "request-value"
- }
- headersText : "GET http://example.com/inspector-test.js HTTP/1.1\r\nRequest: headers-text"
- headersSize : 72
- }
- response : {
- headers : {
- Response : "response-value"
- }
- headersText : "HTTP/1.1 200 OK\r\nResponse: headers-text"
- headersSize : 39
- resourceSize : 1000
- transferSize : 539
- }
-}
-HAR:{
- pageref : "http://example.com/inspector-test.js"
- startedDateTime : <object>
- time : <number>
- request : {
- method : "GET"
- url : "http://example.com/inspector-test.js"
- httpVersion : "HTTP/1.1"
- headers : [
- {
- name : "Request"
- value : "request-value"
- }
- ]
- queryString : [
- ]
- cookies : [
- ]
- headersSize : 72
- bodySize : 0
- }
- response : {
- status : 200
- statusText : "OK"
- httpVersion : "HTTP/1.1"
- headers : [
- {
- name : "Response"
- value : "response-value"
- }
- ]
- cookies : [
- ]
- content : {
- size : 1000
- compression : 500
- mimeType : "text/html"
- }
- redirectURL : ""
- headersSize : 39
- bodySize : 500
- }
- cache : {
- }
- timings : <object>
-}
-
Deleted: trunk/LayoutTests/http/tests/inspector/resource-har-headers.html (87072 => 87073)
--- trunk/LayoutTests/http/tests/inspector/resource-har-headers.html 2011-05-23 14:20:30 UTC (rev 87072)
+++ trunk/LayoutTests/http/tests/inspector/resource-har-headers.html 2011-05-23 14:30:47 UTC (rev 87073)
@@ -1,73 +0,0 @@
-<!doctype html>
-<html>
-<head>
-<script src=""
-<script src=""
-
-<script>
-var test = function()
-{
- function visibleNewlines(s)
- {
- return s.replace(/\r/, "\\r").replace(/\n/, "\\n");
- }
-
- function setResourceValues(resource)
- {
- resource.requestHeaders = {
- "Request": "request-value"
- };
- resource.requestHeadersText = "GET http://example.com/inspector-test.js HTTP/1.1\r\nRequest: headers-text";
-
- resource.responseHeaders = {
- "Response": "response-value"
- };
- resource.responseHeadersText = "HTTP/1.1 200 OK\r\nResponse: headers-text";
-
- resource.documentURL = "http://example.com/inspector-test.js";
- resource.requestMethod = "GET";
- resource.mimeType = "text/html";
- resource.statusCode = 200;
- resource.statusText = "OK";
- resource.resourceSize = 1000;
- resource._transferSize = 539; // 39 = header size at the end of the day
- }
-
- var testResource = new WebInspector.Resource("testResource", "http://example.com/inspector-test.js", 1);
- setResourceValues(testResource);
- var resourceResults = {
- "request": {
- "headers": testResource.requestHeaders,
- "headersText": visibleNewlines(testResource.requestHeadersText),
- "headersSize": testResource.requestHeadersSize,
- },
- "response": {
- "headers": testResource.responseHeaders,
- "headersText": visibleNewlines(testResource.responseHeadersText),
- "headersSize": testResource.responseHeadersSize,
- "resourceSize": testResource.resourceSize,
- "transferSize": testResource.transferSize
- }
- };
- InspectorTest.addObject(resourceResults, {}, "", "Resource:");
-
- var stillNondeterministic = {
- "startedDateTime": 1,
- "time": 1,
- "timings": 1
- };
- InspectorTest.addObject(new WebInspector.HAREntry(testResource).build(), stillNondeterministic, "", "HAR:");
- InspectorTest.completeTest();
-}
-</script>
-
-
-</head>
-
-<body _onload_="runTest()">
-<p>
-Tests the nondeterministic bits of HAR conversion via the magic of hard-coded values.
-</p>
-
-</body>
-</html>
Modified: trunk/LayoutTests/http/tests/inspector/resource-parameters-expected.txt (87072 => 87073)
--- trunk/LayoutTests/http/tests/inspector/resource-parameters-expected.txt 2011-05-23 14:20:30 UTC (rev 87072)
+++ trunk/LayoutTests/http/tests/inspector/resource-parameters-expected.txt 2011-05-23 14:30:47 UTC (rev 87073)
@@ -9,7 +9,6 @@
request : {
method : "POST"
url : "http://localhost:8000/inspector/resources/post-target.cgi?queryParam1=queryValue1&queryParam2="
- httpVersion : "HTTP/1.1"
headers : <object>
queryString : [
{
@@ -23,8 +22,8 @@
]
cookies : [
]
- headersSize : <number>
- bodySize : 33
+ headersSize : -1
+ bodySize : -1
postData : {
mimeType : "application/x-www-form-urlencoded"
text : "formParam1=formValue1&formParam2="
@@ -43,17 +42,15 @@
response : {
status : 200
statusText : "OK"
- httpVersion : "HTTP/1.1"
headers : <object>
cookies : [
]
content : {
size : 14
- compression : 0
mimeType : "application/xml"
}
redirectURL : ""
- headersSize : <number>
+ headersSize : -1
bodySize : 14
}
cache : {
Modified: trunk/LayoutTests/http/tests/inspector/resources-test.js (87072 => 87073)
--- trunk/LayoutTests/http/tests/inspector/resources-test.js 2011-05-23 14:20:30 UTC (rev 87072)
+++ trunk/LayoutTests/http/tests/inspector/resources-test.js 2011-05-23 14:30:47 UTC (rev 87073)
@@ -1,17 +1,17 @@
var initialize_ResourceTest = function() {
InspectorTest.HARNondeterministicProperties = {
- headers: 1,
- headersSize: 1,
- id: 1,
- onContentLoad: 1,
- onLoad: 1,
- receive: 1,
startedDateTime: 1,
time: 1,
+ wait: 1,
+ receive: 1,
+ headers: 1,
timings: 1,
version: 1,
- wait: 1,
+ startedDateTime: 1,
+ id: 1,
+ onContentLoad: 1,
+ onLoad: 1
};
// addObject checks own properties only, so make a deep copy rather than use prototype.
@@ -19,9 +19,7 @@
InspectorTest.HARNondeterministicPropertiesWithSize = JSON.parse(JSON.stringify(InspectorTest.HARNondeterministicProperties));
InspectorTest.HARNondeterministicPropertiesWithSize.size = 1;
InspectorTest.HARNondeterministicPropertiesWithSize.bodySize = 1;
-InspectorTest.HARNondeterministicPropertiesWithSize.compression = 1;
-
InspectorTest.resourceURLComparer = function(r1, r2)
{
return r1.request.url.localeCompare(r2.request.url);
Modified: trunk/Source/WebCore/ChangeLog (87072 => 87073)
--- trunk/Source/WebCore/ChangeLog 2011-05-23 14:20:30 UTC (rev 87072)
+++ trunk/Source/WebCore/ChangeLog 2011-05-23 14:30:47 UTC (rev 87073)
@@ -1,3 +1,31 @@
+2011-05-23 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r87070.
+ http://trac.webkit.org/changeset/87070
+ https://bugs.webkit.org/show_bug.cgi?id=61285
+
+ broke resource-parameters.html on win, weird failures on wk2
+ (Requested by caseq on #webkit).
+
+ * inspector/front-end/HAREntry.js:
+ (WebInspector.HAREntry.prototype.build):
+ (WebInspector.HAREntry.prototype._buildRequest):
+ (WebInspector.HAREntry.prototype._buildResponse):
+ (WebInspector.HAREntry.prototype._buildContent):
+ (WebInspector.HAREntry.prototype._buildCookie):
+ (WebInspector.HAREntry.prototype._interval):
+ (WebInspector.HARLog.prototype.build):
+ * inspector/front-end/Resource.js:
+ (WebInspector.Resource.prototype.set requestHeaders):
+ (WebInspector.Resource.prototype.get requestHeadersText):
+ (WebInspector.Resource.prototype.set requestHeadersText):
+ (WebInspector.Resource.prototype.get requestHeadersSize):
+ (WebInspector.Resource.prototype.set responseHeaders):
+ (WebInspector.Resource.prototype.get responseHeadersText):
+ (WebInspector.Resource.prototype.set responseHeadersText):
+ (WebInspector.Resource.prototype.get responseHeadersSize):
+ (WebInspector.Resource.prototype._headersSize):
+
2011-05-18 Pavel Podivilov <[email protected]>
Reviewed by Yury Semikhatsky.
Modified: trunk/Source/WebCore/inspector/front-end/HAREntry.js (87072 => 87073)
--- trunk/Source/WebCore/inspector/front-end/HAREntry.js 2011-05-23 14:20:30 UTC (rev 87072)
+++ trunk/Source/WebCore/inspector/front-end/HAREntry.js 2011-05-23 14:30:47 UTC (rev 87073)
@@ -48,7 +48,7 @@
time: WebInspector.HAREntry._toMilliseconds(this._resource.duration),
request: this._buildRequest(),
response: this._buildResponse(),
- cache: { }, // Not supported yet.
+ cache: { }, // Not supproted yet.
timings: this._buildTimings()
};
},
@@ -58,16 +58,15 @@
var res = {
method: this._resource.requestMethod,
url: this._resource.url,
- httpVersion: this._resource.requestHttpVersion,
+ // httpVersion: "HTTP/1.1" -- Not available.
headers: this._buildHeaders(this._resource.requestHeaders),
queryString: this._buildParameters(this._resource.queryParameters || []),
cookies: this._buildCookies(this._resource.requestCookies || []),
- headersSize: this._resource.requestHeadersSize,
- bodySize: this.requestBodySize
+ headersSize: -1, // Not available.
+ bodySize: -1 // Not available.
};
if (this._resource.requestFormData)
res.postData = this._buildPostData();
-
return res;
},
@@ -76,13 +75,13 @@
return {
status: this._resource.statusCode,
statusText: this._resource.statusText,
- httpVersion: this._resource.responseHttpVersion,
+ // "httpVersion": "HTTP/1.1" -- Not available.
headers: this._buildHeaders(this._resource.responseHeaders),
cookies: this._buildCookies(this._resource.responseCookies || []),
content: this._buildContent(),
redirectURL: this._resource.responseHeaderValue("Location") || "",
- headersSize: this._resource.responseHeadersSize,
- bodySize: this.responseBodySize
+ headersSize: -1, // Not available.
+ bodySize: this._resource.resourceSize
};
},
@@ -90,9 +89,9 @@
{
return {
size: this._resource.resourceSize,
- compression: this.responseCompression,
+ // compression: 0, -- Not available.
mimeType: this._resource.mimeType,
- // text: this._resource.content // TODO: pull out into a boolean flag, as content can be huge (and needs to be requested with an async call)
+ // text: -- Not available.
};
},
@@ -160,6 +159,7 @@
_buildCookie: function(cookie)
{
+
return {
name: cookie.name,
value: cookie.value,
@@ -178,21 +178,6 @@
return -1;
var startTime = timing[start];
return typeof startTime !== "number" || startTime === -1 ? -1 : Math.round(timing[end] - startTime);
- },
-
- get requestBodySize()
- {
- return !this._resource.requestFormData ? 0 : this._resource.requestFormData.length;
- },
-
- get responseBodySize()
- {
- return this._resource.transferSize - this._resource.responseHeadersSize
- },
-
- get responseCompression()
- {
- return this._resource.resourceSize - (this._resource.transferSize - this._resource.responseHeadersSize);
}
}
@@ -209,7 +194,7 @@
build: function()
{
var webKitVersion = /AppleWebKit\/([^ ]+)/.exec(window.navigator.userAgent);
-
+
return {
version: "1.2",
creator: {
Modified: trunk/Source/WebCore/inspector/front-end/Resource.js (87072 => 87073)
--- trunk/Source/WebCore/inspector/front-end/Resource.js 2011-05-23 14:20:30 UTC (rev 87072)
+++ trunk/Source/WebCore/inspector/front-end/Resource.js 2011-05-23 14:30:47 UTC (rev 87073)
@@ -6,13 +6,13 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -491,30 +491,39 @@
this._requestHeaders = x;
delete this._sortedRequestHeaders;
delete this._requestCookies;
+ delete this._responseHeadersSize;
this.dispatchEventToListeners("requestHeaders changed");
},
get requestHeadersText()
{
- if (this._requestHeadersText === undefined) {
- this._requestHeadersText = this.requestMethod + " " + this.url + " HTTP/1.1\r\n";
- for (var key in this.requestHeaders)
- this._requestHeadersText += key + ": " + this.requestHeaders[key] + "\r\n";
- }
+ if (this._requestHeadersText !== undefined)
+ return this._requestHeadersText;
+
+ this._requestHeadersText = "";
+ for (var key in this.requestHeaders)
+ this._requestHeadersText += key + ": " + this.requestHeaders[key] + "\n";
return this._requestHeadersText;
},
set requestHeadersText(x)
{
this._requestHeadersText = x;
+ delete this._responseHeadersSize;
this.dispatchEventToListeners("requestHeaders changed");
},
get requestHeadersSize()
{
- return this.requestHeadersText.length;
+ if (typeof(this._requestHeadersSize) === "undefined") {
+ if (this._requestHeadersText)
+ this._requestHeadersSize = this._requestHeadersText.length;
+ else
+ this._requestHeadersSize = this._headersSize(this._requestHeaders)
+ }
+ return this._requestHeadersSize;
},
get sortedRequestHeaders()
@@ -553,13 +562,6 @@
delete this._parsedFormParameters;
},
- get requestHttpVersion()
- {
- var firstLine = this.requestHeadersText.split(/\r\n/)[0];
- var match = firstLine.match(/(HTTP\/\d+\.\d+)$/);
- return match ? match[1] : undefined;
- },
-
get responseHeaders()
{
return this._responseHeaders || {};
@@ -568,33 +570,43 @@
set responseHeaders(x)
{
this._responseHeaders = x;
+ delete this._responseHeadersSize;
delete this._sortedResponseHeaders;
delete this._responseCookies;
this.dispatchEventToListeners("responseHeaders changed");
},
-
+
get responseHeadersText()
{
- if (this._responseHeadersText === undefined) {
- this._responseHeadersText = "HTTP/1.1 " + this.statusCode + " " + this.statusText + "\r\n";
- for (var key in this.responseHeaders)
- this._responseHeadersText += key + ": " + this.responseHeaders[key] + "\r\n";
- }
+ if (this._responseHeadersText !== undefined)
+ return this._responseHeadersText;
+
+ this._responseHeadersText = "";
+ for (var key in this.responseHeaders)
+ this._responseHeadersText += key + ": " + this.responseHeaders[key] + "\n";
return this._responseHeadersText;
},
set responseHeadersText(x)
{
this._responseHeadersText = x;
+ delete this._responseHeadersSize;
this.dispatchEventToListeners("responseHeaders changed");
},
-
+
get responseHeadersSize()
{
- return this.responseHeadersText.length;
+ if (typeof(this._responseHeadersSize) === "undefined") {
+ if (this._responseHeadersText)
+ this._responseHeadersSize = this._responseHeadersText.length;
+ else
+ this._responseHeadersSize = this._headersSize(this._responseHeaders)
+ }
+ return this._responseHeadersSize;
},
+
get sortedResponseHeaders()
{
@@ -645,12 +657,6 @@
return this._parsedFormParameters;
},
- get responseHttpVersion()
- {
- var match = this.responseHeadersText.match(/^(HTTP\/\d+\.\d+)/);
- return match ? match[1] : undefined;
- },
-
_parseParameters: function(queryString)
{
function parseNameValue(pair)
@@ -677,6 +683,16 @@
}
},
+ _headersSize: function(headers)
+ {
+ // We should take actual headers size from network stack, when possible, but fall back to
+ // this lousy computation when no headers text is available.
+ var size = 0;
+ for (var header in headers)
+ size += header.length + headers[header].length + 4; // _typical_ overhead per header is ": ".length + "\r\n".length.
+ return size;
+ },
+
get errors()
{
return this._errors || 0;