Diff
Modified: trunk/LayoutTests/ChangeLog (113710 => 113711)
--- trunk/LayoutTests/ChangeLog 2012-04-10 12:34:25 UTC (rev 113710)
+++ trunk/LayoutTests/ChangeLog 2012-04-10 12:53:37 UTC (rev 113711)
@@ -1,3 +1,19 @@
+2012-04-10 Pavel Feldman <[email protected]>
+
+ Web Inspector: make error a string on the front-end side, not an object.
+ https://bugs.webkit.org/show_bug.cgi?id=83570
+
+ Reviewed by Yury Semikhatsky.
+
+ * inspector/debugger/debugger-set-breakpoint-regex-expected.txt:
+ * inspector/debugger/debugger-set-breakpoint-regex.html:
+ * inspector/elements/resolve-node-blocked-expected.txt:
+ * inspector/elements/set-attribute.html:
+ * inspector/profiler/heap-snapshot-inspect-dom-wrapper-expected.txt:
+ * inspector/report-protocol-errors-expected.txt:
+ * inspector/report-protocol-errors.html:
+ * inspector/styles/set-property-boundaries-expected.txt:
+
2012-04-10 Rob Buis <[email protected]>
getElementsByTagName unable to find SVG camelCase elements imported into HTML
Modified: trunk/LayoutTests/inspector/debugger/debugger-set-breakpoint-regex-expected.txt (113710 => 113711)
--- trunk/LayoutTests/inspector/debugger/debugger-set-breakpoint-regex-expected.txt 2012-04-10 12:34:25 UTC (rev 113710)
+++ trunk/LayoutTests/inspector/debugger/debugger-set-breakpoint-regex-expected.txt 2012-04-10 12:53:37 UTC (rev 113711)
@@ -3,16 +3,10 @@
Debugger was enabled.
Running: testSetNoneOfURLAndRegex
-{
- code : -32000
- message : "Either url or urlRegex must be specified."
-}
+Either url or urlRegex must be specified.
Running: testSetBothURLAndRegex
-{
- code : -32000
- message : "Either url or urlRegex must be specified."
-}
+Either url or urlRegex must be specified.
Running: testSetByRegex
Set timer for test function.
Modified: trunk/LayoutTests/inspector/debugger/debugger-set-breakpoint-regex.html (113710 => 113711)
--- trunk/LayoutTests/inspector/debugger/debugger-set-breakpoint-regex.html 2012-04-10 12:34:25 UTC (rev 113710)
+++ trunk/LayoutTests/inspector/debugger/debugger-set-breakpoint-regex.html 2012-04-10 12:53:37 UTC (rev 113711)
@@ -20,9 +20,9 @@
{
DebuggerAgent.setBreakpointByUrl.invoke({lineNumber: 1}, step2);
- function step2(result)
+ function step2(error)
{
- InspectorTest.dump(result);
+ InspectorTest.addResult(error);
next();
}
},
@@ -33,9 +33,9 @@
var urlRegex = "debugger-set-breakpoint.*";
DebuggerAgent.setBreakpointByUrl(1, url, urlRegex, step2);
- function step2(result)
+ function step2(error)
{
- InspectorTest.dump(result);
+ InspectorTest.addResult(error);
next();
}
},
Modified: trunk/LayoutTests/inspector/elements/resolve-node-blocked-expected.txt (113710 => 113711)
--- trunk/LayoutTests/inspector/elements/resolve-node-blocked-expected.txt 2012-04-10 12:34:25 UTC (rev 113710)
+++ trunk/LayoutTests/inspector/elements/resolve-node-blocked-expected.txt 2012-04-10 12:53:37 UTC (rev 113711)
@@ -1,5 +1,5 @@
Tests that JS object to node resolution still works even if script evals are prohibited by Content-Security-Policy. The test passes if it doesn't crash. Bug 78705.
didReceiveDocumentObject
-didRequestNode error = undefined
+didRequestNode error = null
Modified: trunk/LayoutTests/inspector/elements/set-attribute.html (113710 => 113711)
--- trunk/LayoutTests/inspector/elements/set-attribute.html 2012-04-10 12:34:25 UTC (rev 113710)
+++ trunk/LayoutTests/inspector/elements/set-attribute.html 2012-04-10 12:53:37 UTC (rev 113711)
@@ -118,7 +118,7 @@
{
function callback(error)
{
- InspectorTest.addResult("Error: " + error.getMessage());
+ InspectorTest.addResult("Error: " + error);
WebInspector.domAgent.removeEventListener(WebInspector.DOMAgent.Events.AttrModified, callback);
InspectorTest.addResult("=== Set malformed attribute as text ===");
InspectorTest.dumpElementsTree(targetNode);
Modified: trunk/LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper-expected.txt (113710 => 113711)
--- trunk/LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper-expected.txt 2012-04-10 12:34:25 UTC (rev 113710)
+++ trunk/LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper-expected.txt 2012-04-10 12:53:37 UTC (rev 113711)
@@ -2,7 +2,7 @@
_finishHeapSnapshot 1
_callLoadCallbacks
-Error resolving heap snapshot object: Server error(-32000): Object is not available.
-Error resolving heap snapshot object: Server error(-32000): Object is not available.
+Error resolving heap snapshot object: Object is not available
+Error resolving heap snapshot object: Object is not available
clearProfiles
Modified: trunk/LayoutTests/inspector/report-protocol-errors-expected.txt (113710 => 113711)
--- trunk/LayoutTests/inspector/report-protocol-errors-expected.txt 2012-04-10 12:34:25 UTC (rev 113710)
+++ trunk/LayoutTests/inspector/report-protocol-errors-expected.txt 2012-04-10 12:53:37 UTC (rev 113711)
@@ -7,9 +7,6 @@
}
id : null
}
-error.code: -32700
-error.getMessage(): Message must be in JSON format
-error.toString(): Parse error(-32700): Message must be in JSON format.
-------------------------------------------------------
{
error : {
@@ -18,9 +15,6 @@
}
id : null
}
-error.code: -32600
-error.getMessage(): 'id' property was not found
-error.toString(): Invalid Request(-32600): 'id' property was not found.
-------------------------------------------------------
{
error : {
@@ -29,9 +23,6 @@
}
id : null
}
-error.code: -32600
-error.getMessage(): The type of 'id' property must be number
-error.toString(): Invalid Request(-32600): The type of 'id' property must be number.
-------------------------------------------------------
{
error : {
@@ -40,9 +31,6 @@
}
id : 1
}
-error.code: -32600
-error.getMessage(): The type of 'method' property must be string
-error.toString(): Invalid Request(-32600): The type of 'method' property must be string.
-------------------------------------------------------
{
error : {
@@ -51,9 +39,6 @@
}
id : 2
}
-error.code: -32601
-error.getMessage(): 'resourceContent' wasn't found
-error.toString(): Method not found(-32601): 'resourceContent' wasn't found.
-------------------------------------------------------
{
error : {
@@ -62,9 +47,6 @@
}
id : 3
}
-error.code: -32601
-error.getMessage(): 'DOM.test' wasn't found
-error.toString(): Method not found(-32601): 'DOM.test' wasn't found.
-------------------------------------------------------
{
error : {
@@ -77,9 +59,6 @@
}
id : 4
}
-error.code: -32602
-error.getMessage(): Some arguments of method 'Page.getResourceContent' can't be processed
-error.toString(): Invalid params(-32602): Some arguments of method 'Page.getResourceContent' can't be processed. 'params' object must contain required parameter 'frameId' with type 'String'. 'params' object must contain required parameter 'url' with type 'String'.
-------------------------------------------------------
{
error : {
@@ -92,9 +71,6 @@
}
id : 5
}
-error.code: -32602
-error.getMessage(): Some arguments of method 'Page.getResourceContent' can't be processed
-error.toString(): Invalid params(-32602): Some arguments of method 'Page.getResourceContent' can't be processed. 'params' object must contain required parameter 'frameId' with type 'String'. 'params' object must contain required parameter 'url' with type 'String'.
-------------------------------------------------------
{
error : {
@@ -107,9 +83,6 @@
}
id : 6
}
-error.code: -32602
-error.getMessage(): Some arguments of method 'Page.getResourceContent' can't be processed
-error.toString(): Invalid params(-32602): Some arguments of method 'Page.getResourceContent' can't be processed. Parameter 'frameId' with type 'String' was not found. Parameter 'url' with type 'String' was not found.
-------------------------------------------------------
{
error : {
@@ -121,9 +94,6 @@
}
id : 7
}
-error.code: -32602
-error.getMessage(): Some arguments of method 'Page.getResourceContent' can't be processed
-error.toString(): Invalid params(-32602): Some arguments of method 'Page.getResourceContent' can't be processed. Parameter 'url' with type 'String' was not found.
-------------------------------------------------------
{
error : {
@@ -132,9 +102,6 @@
}
id : 8
}
-error.code: -32601
-error.getMessage(): 'Page.test' wasn't found
-error.toString(): Method not found(-32601): 'Page.test' wasn't found.
-------------------------------------------------------
{
error : {
@@ -143,9 +110,6 @@
}
id : 9
}
-error.code: -32601
-error.getMessage(): 'Page.test' wasn't found
-error.toString(): Method not found(-32601): 'Page.test' wasn't found.
-------------------------------------------------------
{
error : {
@@ -154,9 +118,6 @@
}
id : 10
}
-error.code: -32601
-error.getMessage(): 'Page.test' wasn't found
-error.toString(): Method not found(-32601): 'Page.test' wasn't found.
-------------------------------------------------------
{
error : {
@@ -165,9 +126,6 @@
}
id : 11
}
-error.code: -32601
-error.getMessage(): 'Page.test' wasn't found
-error.toString(): Method not found(-32601): 'Page.test' wasn't found.
-------------------------------------------------------
{
error : {
@@ -176,9 +134,6 @@
}
id : 12
}
-error.code: -32601
-error.getMessage(): 'Page.test' wasn't found
-error.toString(): Method not found(-32601): 'Page.test' wasn't found.
-------------------------------------------------------
{
error : {
@@ -187,9 +142,6 @@
}
id : 13
}
-error.code: -32601
-error.getMessage(): 'Page.test' wasn't found
-error.toString(): Method not found(-32601): 'Page.test' wasn't found.
-------------------------------------------------------
{
error : {
@@ -198,9 +150,6 @@
}
id : 14
}
-error.code: -32601
-error.getMessage(): 'Page.test' wasn't found
-error.toString(): Method not found(-32601): 'Page.test' wasn't found.
-------------------------------------------------------
{
error : {
@@ -209,9 +158,6 @@
}
id : 15
}
-error.code: -32601
-error.getMessage(): 'Page.test' wasn't found
-error.toString(): Method not found(-32601): 'Page.test' wasn't found.
-------------------------------------------------------
{
error : {
@@ -220,8 +166,5 @@
}
id : 16
}
-error.code: -32601
-error.getMessage(): 'Page.test' wasn't found
-error.toString(): Method not found(-32601): 'Page.test' wasn't found.
-------------------------------------------------------
Modified: trunk/LayoutTests/inspector/report-protocol-errors.html (113710 => 113711)
--- trunk/LayoutTests/inspector/report-protocol-errors.html 2012-04-10 12:34:25 UTC (rev 113710)
+++ trunk/LayoutTests/inspector/report-protocol-errors.html 2012-04-10 12:53:37 UTC (rev 113711)
@@ -33,9 +33,6 @@
if (numberOfReports < messages.length) {
InspectorTest.addObject(message);
- InspectorTest.addResult("error.code: " + message.error.code);
- InspectorTest.addResult("error.getMessage(): " + message.error.getMessage());
- InspectorTest.addResult("error.toString(): " + message.error);
InspectorTest.addResult("-------------------------------------------------------");
}
Modified: trunk/LayoutTests/inspector/styles/set-property-boundaries-expected.txt (113710 => 113711)
--- trunk/LayoutTests/inspector/styles/set-property-boundaries-expected.txt 2012-04-10 12:34:25 UTC (rev 113710)
+++ trunk/LayoutTests/inspector/styles/set-property-boundaries-expected.txt 2012-04-10 12:53:37 UTC (rev 113711)
@@ -1,5 +1,5 @@
Tests that setting CSS property text out of boundaries does not crash.
color: red;
-Server error(-32000): INDEX_SIZE_ERR.
+INDEX_SIZE_ERR
Modified: trunk/Source/WebCore/ChangeLog (113710 => 113711)
--- trunk/Source/WebCore/ChangeLog 2012-04-10 12:34:25 UTC (rev 113710)
+++ trunk/Source/WebCore/ChangeLog 2012-04-10 12:53:37 UTC (rev 113711)
@@ -1,3 +1,15 @@
+2012-04-10 Pavel Feldman <[email protected]>
+
+ Web Inspector: make error a string on the front-end side, not an object.
+ https://bugs.webkit.org/show_bug.cgi?id=83570
+
+ Reviewed by Yury Semikhatsky.
+
+ We already expect it to be a string in all the code, we never use the error code in it.
+
+ * inspector/front-end/InspectorBackend.js:
+ (InspectorBackendClass.prototype.dispatch):
+
2012-04-10 Rob Buis <[email protected]>
getElementsByTagName unable to find SVG camelCase elements imported into HTML
Modified: trunk/Source/WebCore/inspector/front-end/InspectorBackend.js (113710 => 113711)
--- trunk/Source/WebCore/inspector/front-end/InspectorBackend.js 2012-04-10 12:34:25 UTC (rev 113710)
+++ trunk/Source/WebCore/inspector/front-end/InspectorBackend.js 2012-04-10 12:53:37 UTC (rev 113711)
@@ -163,31 +163,6 @@
if ("id" in messageObject) { // just a response for some request
if (messageObject.error) {
- messageObject.error.__proto__ = {
- getDescription: function()
- {
- switch(this.code) {
- case -32700: return "Parse error";
- case -32600: return "Invalid Request";
- case -32601: return "Method not found";
- case -32602: return "Invalid params";
- case -32603: return "Internal error";;
- case -32000: return "Server error";
- }
- },
-
- toString: function()
- {
- var description ="Unknown error code";
- return this.getDescription() + "(" + this.code + "): " + this.message + "." + (this.data ? " " + this.data.join(" ") : "");
- },
-
- getMessage: function()
- {
- return this.message;
- }
- }
-
if (messageObject.error.code !== -32000)
this.reportProtocolError(messageObject);
}
@@ -207,7 +182,7 @@
if (this.dumpInspectorTimeStats && callback.methodName)
processingStartTime = Date.now();
- argumentsArray.unshift(messageObject.error);
+ argumentsArray.unshift(messageObject.error ? messageObject.error.message : null);
callback.apply(null, argumentsArray);
--this._pendingResponsesCount;
delete this._callbacks[messageObject.id];