Closed Bug 1404877 Opened 2 years ago Closed 2 years ago

Migrate browser_webconsole_bug_658368_time_methods.js to the new frontend

Categories

(DevTools :: Console, enhancement, P1)

enhancement

Tracking

(firefox57 wontfix, firefox58 wontfix, firefox60 fixed)

RESOLVED FIXED
Firefox 60
Tracking Status
firefox57 --- wontfix
firefox58 --- wontfix
firefox60 --- fixed

People

(Reporter: nchevobbe, Assigned: sole)

References

(Blocks 1 open bug)

Details

(Whiteboard: [newconsole-mvp])

Attachments

(1 file)

this should be only about testing that we don't mix console.time in different tabs.
Priority: -- → P3
Priority: P3 → P2
Whiteboard: [newconsole-mvp]
Assignee: nobody → spenades
Status: NEW → ASSIGNED
Priority: P2 → P1
Comment on attachment 8951548 [details]
Bug 1404877 - Migrate browser_webconsole_bug_658368_time_methods.js to the new frontend.

https://reviewboard.mozilla.org/r/220858/#review226792

I only have one comment, but the test is already working and is ready to land imo. Thanks a lot Sole !

::: devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_time_methods.js:48
(Diff revision 1)
> -  BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URI3);
> -
> -  yield waitForMessages({
> -    webconsole: hud2,
> +  let message1 = await new Promise(resolve => {
> +    setTimeout(() => {
> +      resolve(findMessage(hud2, "bTimer started"));
> +    }, 250);
> -    messages: [{
> -      name: "bTimer started",
> -      consoleTime: "bTimer",
> -    }],
>    });

so, instead of waiting for an arbitrary number of milliseconds, could we have in the support file a "smoke signal" message just after the console.time ?

```js
function foo() {
  console.timeEnd("aTimer");
}
console.time("aTimer");
foo();
console.time("bTimer");
console.log("smoke signal")
```

(or something better in the log).
The console API guarantee us that smoke signal would be printed after a message for console.time("bTimer").

So we could do :
```js
await waitFor(() => findMessage(hud2, "smoke signal"));
is(findMessage(hud2, "bTimer started"), null, "no message is printed:...")
```

what do you think of this ?
Attachment #8951548 - Flags: review?(nchevobbe) → review+
Comment on attachment 8951548 [details]
Bug 1404877 - Migrate browser_webconsole_bug_658368_time_methods.js to the new frontend.

https://reviewboard.mozilla.org/r/220858/#review226830

thanks sole :)
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/06c8e6e3303c
Migrate browser_webconsole_bug_658368_time_methods.js to the new frontend. r=nchevobbe
https://hg.mozilla.org/mozilla-central/rev/06c8e6e3303c
Status: ASSIGNED → RESOLVED
Closed: 2 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.