Changeset 142486 in webkit
- Timestamp:
- Feb 11, 2013 10:05:33 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r142485 r142486 1 2013-02-01 Andrey Kosyakov <caseq@chromium.org> 2 3 Web Inspector: [Extension API] adjust inspectedWindow.eval() callback parameters to expose non-exceptional error 4 https://bugs.webkit.org/show_bug.cgi?id=108640 5 6 Reviewed by Vsevolod Vlasov. 7 8 Rebase tests following change in exception parameter to inspectedWindow.eval() callback. 9 10 * inspector/extensions/extensions-eval-expected.txt: 11 * inspector/extensions/extensions-eval.html: 12 * inspector/extensions/extensions-sidebar-expected.txt: 13 1 14 2013-02-11 Andrey Kosyakov <caseq@chromium.org> 2 15 -
trunk/LayoutTests/inspector/extensions/extensions-eval-expected.txt
r140114 r142486 12 12 Evaluate: 0 (exception: undefined) 13 13 RUNNING TEST: extension_testEvalStringifyingLoopFailed 14 Evaluate: "Object has too long reference chain(must not be longer than 1000)" (exception: true) 14 log: Extension server error: Inspector protocol error: Object has too long reference chain(must not be longer than 1000) 15 Evaluate: undefined (exception: {"code":"E_PROTOCOLERROR","description":"Inspector protocol error: %s","details":["Object has too long reference chain(must not be longer than 1000)"],"isError":true}) 15 16 RUNNING TEST: extension_testEvalThrows 16 Evaluate: "testExceptionString" (exception: true)17 Evaluate: undefined (exception: {"isException":true,"value":"testExceptionString"}) 17 18 RUNNING TEST: extension_testEvalUndefined 18 19 Evaluate: undefined (exception: undefined) -
trunk/LayoutTests/inspector/extensions/extensions-eval.html
r140114 r142486 52 52 } 53 53 54 function extension_onEval(value, isException)54 function extension_onEval(value, status) 55 55 { 56 output("Evaluate: " + JSON.stringify(value) + " (exception: " + isException + ")"); 56 var exceptionString = typeof status === "undefined" ? "undefined" : JSON.stringify(status); 57 output("Evaluate: " + JSON.stringify(value) + " (exception: " + exceptionString + ")"); 57 58 } 58 59 -
trunk/LayoutTests/inspector/extensions/extensions-sidebar-expected.txt
r127147 r142486 7 7 Got onShown(), frame not defined 8 8 RUNNING TEST: extension_testSidebarSetExpression 9 log: Extension server error: Inspector protocol error: Object has too long reference chain(must not be longer than 1000) 9 10 Sidebar content: titlef0: "expression"f1: undefinedf2: nullf3: Objectf4: Array[0]f5: Array[3]f6: Objectf7: 42f8: Locationf9: HTMLCollection[2]f10: function () {}f11: "foo"__proto__: Object 10 11 RUNNING TEST: extension_testSidebarSetObject -
trunk/Source/WebCore/ChangeLog
r142485 r142486 1 2013-02-01 Andrey Kosyakov <caseq@chromium.org> 2 3 Web Inspector: [Extension API] adjust inspectedWindow.eval() callback parameters to expose non-exceptional error 4 https://bugs.webkit.org/show_bug.cgi?id=108640 5 6 Reviewed by Vsevolod Vlasov. 7 8 - only set first parameter to eval() callback iff expression successfully evaluates; 9 - use object, not bool as second parameter; 10 - pass exceptions and extension errors as second parameter if evaluate failed; 11 - minor drive-by changes in ExtensionAPI utilities. 12 13 * inspector/front-end/ExtensionAPI.js: 14 (injectedExtensionAPI.ExtensionSidebarPaneImpl.prototype.setExpression): 15 (injectedExtensionAPI.InspectedWindow.prototype.): 16 (injectedExtensionAPI.InspectedWindow.prototype.eval): 17 (injectedExtensionAPI.extractCallbackArgument): 18 * inspector/front-end/ExtensionServer.js: 19 (WebInspector.ExtensionServer.prototype.): 20 (WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage): 21 (WebInspector.ExtensionStatus): 22 1 23 2013-02-11 Andrey Kosyakov <caseq@chromium.org> 2 24 -
trunk/Source/WebCore/inspector/front-end/ExtensionAPI.js
r142485 r142486 450 450 setExpression: function(expression, rootTitle, evaluateOptions) 451 451 { 452 var callback = extractCallbackArgument(arguments);453 452 var request = { 454 453 command: commands.SetSidebarContent, … … 460 459 if (typeof evaluateOptions === "object") 461 460 request.evaluateOptions = evaluateOptions; 462 extensionServer.sendRequest(request, callback);461 extensionServer.sendRequest(request, extractCallbackArgument(arguments)); 463 462 }, 464 463 … … 658 657 function callbackWrapper(result) 659 658 { 660 callback(result.value, result.isException); 659 if (result.isError || result.isException) 660 callback(undefined, result); 661 else 662 callback(result.value); 661 663 } 662 664 var request = { -
trunk/Source/WebCore/inspector/front-end/ExtensionServer.js
r142283 r142486 330 330 function callback(error, resultPayload, wasThrown) 331 331 { 332 var result = {}; 333 if (error) { 334 result.isException = true; 335 result.value = error.toString(); 336 } else if (wasThrown) { 337 result.isException = true; 338 result.value = resultPayload.description; 339 } else { 340 result.value = resultPayload.value; 341 } 332 if (error) 333 result = this._status.E_PROTOCOLERROR(error.toString()); 334 else if (wasThrown) 335 result = { isException: true, value: resultPayload.description }; 336 else 337 result = { value: resultPayload.value }; 342 338 343 339 this._dispatchCallback(message.requestId, port, result); … … 820 816 this.E_NOTFOUND = makeStatus.bind(null, "E_NOTFOUND", "Object not found: %s"); 821 817 this.E_NOTSUPPORTED = makeStatus.bind(null, "E_NOTSUPPORTED", "Object does not support requested operation: %s"); 818 this.E_PROTOCOLERROR = makeStatus.bind(null, "E_PROTOCOLERROR", "Inspector protocol error: %s"); 822 819 this.E_FAILED = makeStatus.bind(null, "E_FAILED", "Operation failed: %s"); 823 820 }
Note: See TracChangeset
for help on using the changeset viewer.