Closed Bug 1432865 Opened 6 years ago Closed 6 years ago

Clean up show and hideColumn test API

Categories

(DevTools :: Netmonitor, enhancement)

enhancement
Not set
normal

Tracking

(firefox60 fixed)

RESOLVED FIXED
Firefox 60
Tracking Status
firefox60 --- fixed

People

(Reporter: Honza, Assigned: abhinav.koppula)

Details

(Keywords: good-first-bug)

Attachments

(1 file)

Netmonitor's tests are using two helpers:

* showColumn
* hideColumn

These are defined in several tests and also in head.js file

The bug should:
1) Make sure there is just one definition of these methods (if possible)
2) The methods use async/await instead of function*/yield

Honza
Hi Honza,
I have created a review-request for this issue.

On searching showColumn in searchFox,
https://dxr.mozilla.org/mozilla-central/search?q=showColumn&redirect=false
showColumn in netmonitor exists only in devtools/client/netmonitor/test/browser_net_columns_pref.js

There is a method showColumn also present in storage/head.js. I don't think we are supposed to touch that, right?
Flags: needinfo?(odvarko)
Thanks!

I can't apply the patch on latest m-c head. Does this need to be rebased?

Honza
Flags: needinfo?(abhinav.koppula)
Note that this is a follow up for bug 1431912

Honza
Hi Honza,
Have rebased with the latest m-c.
Flags: needinfo?(abhinav.koppula)
Comment on attachment 8945332 [details]
Bug 1432865 - Clean up show and hideColumn test API.

https://reviewboard.mozilla.org/r/215540/#review221274

Thanks!

R+, but I have one inline question

Try push:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a1beb471ef4f77207f48415bf8b5a0fa8a92640f

Honza

::: devtools/client/netmonitor/test/browser_net_columns_time.js:19
(Diff revision 2)
>    let Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
>    store.dispatch(Actions.batchEnable(false));
>  
> -  hideColumn(monitor, "waterfall");
> -  showColumn(monitor, "endTime");
> -  showColumn(monitor, "responseTime");
> +  let visibleColumns = store.getState().ui.columns;
> +  if (visibleColumns.waterfall) {
> +    await hideColumn(monitor, "waterfall");

Why is this needed? The Waterfall column should be visible by default, no?

Here is the default set of visible columns:
https://searchfox.org/mozilla-central/rev/4611b9541894e90a421debb57ddbbcff55c2f369/devtools/client/netmonitor/test/head.js#99
Attachment #8945332 - Flags: review?(odvarko) → review+
Flags: needinfo?(odvarko)
Comment on attachment 8945332 [details]
Bug 1432865 - Clean up show and hideColumn test API.

https://reviewboard.mozilla.org/r/215540/#review221274

> Why is this needed? The Waterfall column should be visible by default, no?
> 
> Here is the default set of visible columns:
> https://searchfox.org/mozilla-central/rev/4611b9541894e90a421debb57ddbbcff55c2f369/devtools/client/netmonitor/test/head.js#99

Hi Honza,
Here, previously we were calling hideColumn and showColumn without yield. If I `await` for hideColumn/showColumn after my changes, the tests are failing because I think we are trying to toggle a column which is already visible. So instead, I check if the column is already visible/invisible and then call hideColumn/showColumn accordingly (like it is done for test - browser_net_columns_last_column.js) 

I am not sure why we were hiding/showing the above columns in the first place because even if I just remove those 5 statements, the test still passes.
(In reply to Abhinav Koppula from comment #8)
> Comment on attachment 8945332 [details]
> Bug 1432865 - Clean up show and hideColumn test API.
> 
> https://reviewboard.mozilla.org/r/215540/#review221274
> 
> > Why is this needed? The Waterfall column should be visible by default, no?
> > 
> > Here is the default set of visible columns:
> > https://searchfox.org/mozilla-central/rev/4611b9541894e90a421debb57ddbbcff55c2f369/devtools/client/netmonitor/test/head.js#99
> 
> Hi Honza,
> Here, previously we were calling hideColumn and showColumn without yield. If
> I `await` for hideColumn/showColumn after my changes, the tests are failing
> because I think we are trying to toggle a column which is already visible.
> So instead, I check if the column is already visible/invisible and then call
> hideColumn/showColumn accordingly (like it is done for test -
> browser_net_columns_last_column.js) 
OK
 
> I am not sure why we were hiding/showing the above columns in the first
> place because even if I just remove those 5 statements, the test still
> passes.
Ah, a comment would be helpful here.

Can you please yet append the following comment before hiding the waterfall column:

// Hide the waterfall column to make sure timing data are fetched
// by the other timing columns ("endTime", "responseTime", "duration",
// "latency").
// Note that all these timing columns are based on the same
// `RequestListColumnTime` component.

Honza
Assignee: nobody → abhinav.koppula
Status: NEW → ASSIGNED
Hi Honza,
I've updated the review-request with the comment.
ok, thanks!

This is ready to land.
Honza
Keywords: checkin-needed
Pushed by btara@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/41237a18fbea
Clean up show and hideColumn test API. r=Honza
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/41237a18fbea
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 60
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: