Bug 141403

Summary: Web Inspector: backend command promises are not rejected when a protocol error occurs
Product: WebKit Reporter: Brian Burg <burg>
Component: Web InspectorAssignee: BJ Burg <bburg>
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 147067    
Description Flags
Proposed Fix joepeck: review+, joepeck: commit-queue-

Description Brian Burg 2015-02-09 14:34:52 PST
I would expect that DOMAgent.highlightNode.promise() [missing a single required argument] would cause the promise to be rejected, but instead it is fulfilled with value 'null', while logging something to the console. What is the expected behavior here?
Comment 1 Radar WebKit Bug Importer 2015-02-09 14:35:24 PST
Comment 2 Timothy Hatcher 2015-02-12 19:33:37 PST
I agree it should reject if it is missing required arguments.
Comment 3 BJ Burg 2015-09-14 14:36:18 PDT
I have written a test for this new behavior, and am implementing changes now.
Comment 4 BJ Burg 2015-09-14 15:31:01 PDT
Created attachment 261142 [details]
Proposed Fix
Comment 5 WebKit Commit Bot 2015-09-14 15:33:18 PDT
Attachment 261142 [details] did not pass style-queue:

ERROR: Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:493:  Line contains single-quote character.  [js/syntax] [5]
ERROR: Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:500:  Line contains single-quote character.  [js/syntax] [5]
ERROR: Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js:506:  Line contains single-quote character.  [js/syntax] [5]
Total errors found: 3 in 5 files

If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Joseph Pecoraro 2015-09-14 16:39:32 PDT
Comment on attachment 261142 [details]
Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=261142&action=review


> LayoutTests/inspector/protocol/inspector-backend-invocation-return-value-expected.txt:25
> +PASS: a successful command should invoke the callback with a 'null' first parameter.

Lots of lowercase "a"s in here that should be capitalized.

> LayoutTests/inspector/protocol/inspector-backend-invocation-return-value.html:125
> +        description: "Backend command's returned promise should be rejected if the command lacks required arguments.",

Nit: "Backend command's returned promise ..." => "Backend command callback ..."
Comment 7 BJ Burg 2015-09-14 17:10:14 PDT
Committed r189761: <http://trac.webkit.org/changeset/189761>