Bug 141403 - Web Inspector: backend command promises are not rejected when a protocol error occurs
Summary: Web Inspector: backend command promises are not rejected when a protocol erro...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: BJ Burg
Keywords: InRadar
Depends on:
Blocks: InspectorProtocol
  Show dependency treegraph
Reported: 2015-02-09 14:34 PST by Brian Burg
Modified: 2015-09-14 17:10 PDT (History)
9 users (show)

See Also:

Proposed Fix (15.84 KB, patch)
2015-09-14 15:31 PDT, BJ Burg
joepeck: review+
joepeck: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>