convert uses of "defer" to "new Promise" - client/netmonitor directory

RESOLVED FIXED in Firefox 55

Status

defect
P1
normal
RESOLVED FIXED
2 years ago
a year ago

People

(Reporter: powell.759, Assigned: powell.759)

Tracking

(Blocks 1 bug)

unspecified
Firefox 55
Dependency tree / graph
Bug Flags:
qe-verify -

Firefox Tracking Flags

(firefox55 fixed)

Details

(Whiteboard: [netmonitor-reserve])

Attachments

(1 attachment, 8 obsolete attachments)

Assignee

Description

2 years ago
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Build ID: 20170317213149
Assignee

Updated

2 years ago
Component: Untriaged → Developer Tools: Netmonitor

Updated

2 years ago
Blocks: 1283869
Assignee

Comment 1

2 years ago
Looks like good work here!

Honza
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: qe-verify?
Priority: -- → P3
Whiteboard: [netmonitor][triage]
Flags: qe-verify? → qe-verify-
Whiteboard: [netmonitor][triage] → [netmonitor]
Priority: P3 → P2
Assignee

Comment 3

2 years ago
Posted patch patch for review (obsolete) — Splinter Review
Attachment #8851445 - Attachment is obsolete: true
Assignee

Comment 4

2 years ago
Posted patch bug1350648.patch (obsolete) — Splinter Review
Attachment #8853707 - Attachment is obsolete: true

Updated

2 years ago
Assignee: nobody → powell.759
Comment on attachment 8853837 [details] [diff] [review]
bug1350648.patch

Review of attachment 8853837 [details] [diff] [review]:
-----------------------------------------------------------------

Thank you for doing this.
I have a few nits but in general this is looking good.

Can you submit the updated patch to try?
If not, let me know, and I will do it.

Also, you should append ", r?tromey" to the commit message.

::: devtools/client/netmonitor/test/browser_net_throttle.js
@@ +15,5 @@
>  
>    let { monitor } = yield initNetMonitor(SIMPLE_URL);
>    let { gStore, windowRequire, NetMonitorController } = monitor.panelWin;
> +  let { ACTIVITY_TYPE } = windowRequire("devtools/client/netmonitor/src/constants");
> +  let { EVENTS } = windowRequire("devtools/client/netmonitor/src/constants");

These seem like unrelated changes.

@@ +40,4 @@
>    let client = NetMonitorController.webConsoleClient;
>  
>    info("sending throttle request");
> +  yield new Promise((resolve, reject) => {

I think you can drop ", reject" here.
Keeping it seems like it would trigger an eslint warning.

::: devtools/client/netmonitor/test/head.js
@@ +13,4 @@
>    "chrome://mochitests/content/browser/devtools/client/framework/test/shared-head.js",
>    this);
>  
> +const { EVENTS } = require("devtools/client/netmonitor/src/constants");

This seems like an unrelated change.

@@ +180,4 @@
>  }
>  
>  function waitForNetworkEvents(monitor, getRequests, postRequests = 0) {
> +  return Promise((resolve, reject) => {

I think this doesn't need "reject".

@@ +384,4 @@
>   *        Returns a promise that resolves upon firing of the event.
>   */
>  function waitFor(subject, eventName) {
> +  return new Promise((resolve, reject) => {

Likewise.

@@ +499,4 @@
>  function waitForContentMessage(name) {
>    let mm = gBrowser.selectedBrowser.messageManager;
>  
> +  return new Promise((resolve, reject) => {

Likewise.
Status: NEW → ASSIGNED
Priority: P2 → P3
Whiteboard: [netmonitor] → [netmonitor-reserve]
Assignee

Comment 6

2 years ago
This is my first time using Hg so I'm having a little trouble with changes I pulled mixing up with my own. I should have just made my changes on my own branch. I'll get on the IRC and see if I can get a little guidance on keeping my patches clean.

I'll remove all those "reject"s and resubmit a patch. I'll try to push to try but If I have trouble I'll check back in. Copy on the commit message.
Assignee

Comment 7

2 years ago
Posted patch updated patch (obsolete) — Splinter Review
Attachment #8853837 - Attachment is obsolete: true
Attachment #8856265 - Flags: review?(ttromey)
Assignee

Comment 8

2 years ago
Posted patch updated patch (obsolete) — Splinter Review
Attachment #8856265 - Attachment is obsolete: true
Attachment #8856265 - Flags: review?(ttromey)
Attachment #8856266 - Flags: review?(ttromey)
Assignee

Comment 9

2 years ago
@trom(In reply to Tom Tromey :tromey from comment #5)
> Comment on attachment 8853837 [details] [diff] [review]
> bug1350648.patch
> 
> Review of attachment 8853837 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Thank you for doing this.
> I have a few nits but in general this is looking good.
> 
> Can you submit the updated patch to try?
> If not, let me know, and I will do it.
> 
> Also, you should append ", r?tromey" to the commit message.
> 
> ::: devtools/client/netmonitor/test/browser_net_throttle.js
> @@ +15,5 @@
> >  
> >    let { monitor } = yield initNetMonitor(SIMPLE_URL);
> >    let { gStore, windowRequire, NetMonitorController } = monitor.panelWin;
> > +  let { ACTIVITY_TYPE } = windowRequire("devtools/client/netmonitor/src/constants");
> > +  let { EVENTS } = windowRequire("devtools/client/netmonitor/src/constants");
> 
> These seem like unrelated changes.
> 
> @@ +40,4 @@
> >    let client = NetMonitorController.webConsoleClient;
> >  
> >    info("sending throttle request");
> > +  yield new Promise((resolve, reject) => {
> 
> I think you can drop ", reject" here.
> Keeping it seems like it would trigger an eslint warning.
> 
> ::: devtools/client/netmonitor/test/head.js
> @@ +13,4 @@
> >    "chrome://mochitests/content/browser/devtools/client/framework/test/shared-head.js",
> >    this);
> >  
> > +const { EVENTS } = require("devtools/client/netmonitor/src/constants");
> 
> This seems like an unrelated change.
> 
> @@ +180,4 @@
> >  }
> >  
> >  function waitForNetworkEvents(monitor, getRequests, postRequests = 0) {
> > +  return Promise((resolve, reject) => {
> 
> I think this doesn't need "reject".
> 
> @@ +384,4 @@
> >   *        Returns a promise that resolves upon firing of the event.
> >   */
> >  function waitFor(subject, eventName) {
> > +  return new Promise((resolve, reject) => {
> 
> Likewise.
> 
> @@ +499,4 @@
> >  function waitForContentMessage(name) {
> >    let mm = gBrowser.selectedBrowser.messageManager;
> >  
> > +  return new Promise((resolve, reject) => {
> 
> Likewise.

I've went ahead and made these changes and attached an updated patch.I don't have the permission yet to push to try. So you could do that?
Comment on attachment 8856266 [details] [diff] [review]
updated patch

Review of attachment 8856266 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good.  Thanks!
I'll push it through try soon.
Attachment #8856266 - Flags: review?(ttromey) → review+
According to the try log there is a missing "new" somewhere...
Flags: needinfo?(powell.759)
Assignee

Comment 13

2 years ago
(In reply to Tom Tromey :tromey from comment #12)
> According to the try log there is a missing "new" somewhere...

I found the missing "new". Attaching an updated patch with this and the lint warnings corrected.
Flags: needinfo?(powell.759)
Assignee

Comment 14

2 years ago
Posted patch update patch for bug 1350648 (obsolete) — Splinter Review
Attachment #8856266 - Attachment is obsolete: true
Attachment #8857042 - Flags: review?(ttromey)
Comment on attachment 8857042 [details] [diff] [review]
update patch for bug 1350648

Review of attachment 8857042 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks.  I will push this through try momentarily.
Attachment #8857042 - Flags: review?(ttromey) → review+

Updated

2 years ago
Keywords: checkin-needed
Patch needs to be rebased.
Keywords: checkin-needed
Hi Maxwell - could you rebase this?
Flags: needinfo?(powell.759)
Assignee

Comment 19

2 years ago
Posted patch rebased patch for bug 1350648 (obsolete) — Splinter Review
Flags: needinfo?(powell.759)
Attachment #8857661 - Flags: review?(ttromey)

Updated

2 years ago
Attachment #8857042 - Attachment is obsolete: true

Updated

2 years ago
Attachment #8857661 - Flags: review?(ttromey) → review+

Updated

2 years ago
Keywords: checkin-needed
Assignee

Comment 20

2 years ago
Cancel that, I'm going to need to rewrite parts. It looks like changes were made within the functions I rewrote so I will need to sort those out
Flags: needinfo?(ttromey)
Assignee

Comment 21

2 years ago
Posted patch bug1350648.patch (obsolete) — Splinter Review
Attachment #8857661 - Attachment is obsolete: true
Attachment #8857681 - Flags: review?(ttromey)
Assignee

Comment 22

2 years ago
Apologies for the confusion here, I wasn't able to rebase completely since there were some conflicting changes. I have done my best to remedy this but it should probably be ran through the try server again before check-in because I am not confident everything is correct here.

Updated

2 years ago
Flags: needinfo?(ttromey)
Keywords: checkin-needed
Comment on attachment 8857681 [details] [diff] [review]
bug1350648.patch

Review of attachment 8857681 [details] [diff] [review]:
-----------------------------------------------------------------

Thank you for the rebase.  It still looks good to me!  I'm going to push it through try again as you suggested.
Attachment #8857681 - Flags: review?(ttromey) → review+
Assignee

Comment 25

2 years ago
Welcome! Try caught an error so I'm attaching an updated patch now.
Assignee

Comment 26

2 years ago
Attachment #8857681 - Attachment is obsolete: true
Attachment #8857991 - Flags: review?(ttromey)

Updated

2 years ago
Attachment #8857991 - Flags: review?(ttromey) → review+

Updated

2 years ago
Keywords: checkin-needed

Comment 28

2 years ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/2c4240b6dff9
Replace defer with new Promise in devtools/client/netmonitor directory. r=tromey
Keywords: checkin-needed

Comment 29

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/2c4240b6dff9
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Iteration: --- → 55.3 - Apr 17
Priority: P3 → P1

Updated

a year ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.