Bug 178805

Summary: Web Inspector: Canvas Tab: starting a second recording doesn't show red titlebar if the first recording was empty
Product: WebKit Reporter: Brian Burg <bburg>
Component: Web InspectorAssignee: Devin Rousso <drousso>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, drousso, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
URL: http://acko.net
Bug Depends on:    
Bug Blocks: 173807, 175485    
Attachments:
Description Flags
Patch
none
Patch none

Description Brian Burg 2017-10-25 10:12:56 PDT
STR:

1. Go to a site with a canvas that doesn't do anything without interaction (acko.net)
2. Select the Canvas, start a recording
3. Stop the recording
=> Nothing happens, the recording is empty
4. Start a new recording again
=> Red titlebar not present, Recording button doesn't change from circle to square
Comment 1 Radar WebKit Bug Importer 2017-10-25 10:13:19 PDT
<rdar://problem/35176303>
Comment 2 Devin Rousso 2017-10-25 12:31:44 PDT
Created attachment 324865 [details]
Patch
Comment 3 Brian Burg 2017-10-25 13:24:13 PDT
Comment on attachment 324865 [details]
Patch

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

r=me with some test issues. Please re-EWS the test changes, thanks.

> LayoutTests/inspector/canvas/recording-2d.html:480
> +                throw "Missing 2D canvas.";

Does an async function wrap this in an Error? If not, please throw an Error. Throwing a string will lose exception context, IIRC.

> LayoutTests/inspector/canvas/recording-2d.html:493
> +            await CanvasAgent.stopRecording(canvas.identifier);

It is weird to use CanvasAgent directly, but use CanvasManager right above. I'd prefer you stick to manager API if using inspector-test.js
Comment 4 Devin Rousso 2017-10-25 14:14:51 PDT
Comment on attachment 324865 [details]
Patch

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

>> LayoutTests/inspector/canvas/recording-2d.html:493
>> +            await CanvasAgent.stopRecording(canvas.identifier);
> 
> It is weird to use CanvasAgent directly, but use CanvasManager right above. I'd prefer you stick to manager API if using inspector-test.js

The issue with using CanvasManager is that it doesn't return a promise, meaning that we cant use async-await.  I'll restructure the test to make it work.
Comment 5 Devin Rousso 2017-10-25 14:20:08 PDT
Created attachment 324895 [details]
Patch
Comment 6 Brian Burg 2017-10-25 14:45:24 PDT
Comment on attachment 324895 [details]
Patch

r=mews
Comment 7 Brian Burg 2017-10-25 14:45:49 PDT
(In reply to Devin Rousso from comment #4)
> Comment on attachment 324865 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=324865&action=review
> 
> >> LayoutTests/inspector/canvas/recording-2d.html:493
> >> +            await CanvasAgent.stopRecording(canvas.identifier);
> > 
> > It is weird to use CanvasAgent directly, but use CanvasManager right above. I'd prefer you stick to manager API if using inspector-test.js
> 
> The issue with using CanvasManager is that it doesn't return a promise,
> meaning that we cant use async-await.  I'll restructure the test to make it
> work.

I figured. Sorry to ruin your fun. Someday we'll fix that?
Comment 8 WebKit Commit Bot 2017-10-25 16:50:15 PDT
Comment on attachment 324895 [details]
Patch

Clearing flags on attachment: 324895

Committed r223998: <https://trac.webkit.org/changeset/223998>
Comment 9 WebKit Commit Bot 2017-10-25 16:50:16 PDT
All reviewed patches have been landed.  Closing bug.