Closed Bug 1553854 Opened 6 years ago Closed 4 years ago

Implement Runtime.consoleAPICalled

Categories

(Remote Protocol :: CDP, enhancement, P1)

enhancement

Tracking

(firefox85 fixed)

RESOLVED FIXED
85 Branch
Tracking Status
firefox85 --- fixed

People

(Reporter: ochameau, Assigned: whimboo)

References

Details

(Whiteboard: [puppeteer-beta2-mvp])

Attachments

(1 file)

This is being used by the test framework of gutenberg to assert this isn't unexpected console calls.
Unfortunately, this is also making many tests to fail as I think we are getting unexpected console calls due to difference in Firefox being different than Chrome. We should most likely ignore firefox specifics from gutenberg tests.

If Gutenberg is using that to making some decision without looking
at the contents of those console calls, what you say makes sense.

Here is the code, there is only a few cases being ignored:
https://github.com/WordPress/gutenberg/blob/master/packages/e2e-tests/config/setup-test-framework.js#L107-L159
But I don't recall if that makes tests to fail.

Whiteboard: [puppeteer-alp
Whiteboard: [puppeteer-alp → [puppeteer-alpha]

In Puppeteer this finally ends-up as Events.Page.Console, and gets emitted in _addConsoleMessage:

https://github.com/GoogleChrome/puppeteer/blob/master/lib/Page.js#L610-L630

I cannot find anything related to Page.Console in the Gutenberg e2e tests. As such this shouldn't block the alpha release.

No longer blocks: puppeteer-gutenberg
Priority: P2 → P3
Whiteboard: [puppeteer-alpha]

Actually I missed comment 2 from above, and I should not have searched for Page.Console only. So Alexandre's point is still valid, and as such might have to block the alpha release.

Priority: P3 → P2
Whiteboard: [puppeteer-alpha]
Priority: P2 → P3
Whiteboard: [puppeteer-alpha] → [puppeteer-alpha-reserve]
Priority: P3 → P2
Whiteboard: [puppeteer-alpha-reserve] → [puppeteer-beta-mvp]

Note that the code Alexandre pointed out in comment 2 uses specific error messages like net::ERR_UNKNOWN_URL_SCHEME only sent by Chrome. With Maja's navigation patch on bug 1599257, we will also send out error messages soon, but the Gutenberg harness clearly would need an update.

Whiteboard: [puppeteer-beta-mvp] → [puppeteer-beta-reserve]
Whiteboard: [puppeteer-beta-reserve] → [puppeteer-beta2-mvp]

This is actually blocking the opt-in for WebDriver clients with Selenium 4. As such I'm going to work on it now.

Assignee: nobody → hskupin
Blocks: 1669746
Status: NEW → ASSIGNED
Priority: P2 → P1

Message as returned by Chrome look like:

>>> {
  message: {
    source: 'console-api',
    level: 'info',
    text: 'foo',
    url: '',
    line: 1,
    column: 9
  }
}
{
  message: {
    source: 'console-api',
    level: 'log',
    text: 'foo',
    url: '',
    line: 1,
    column: 9
  }
}

Also note that when the API has already been used before the Runtime domain was enabled it sends past events too. I assume that we can query for those via the internal Console API. Maybe this should be a follow-up.

Blocks: 1679808
Blocks: 1679887
Blocks: 1679981
Blocks: 1680504
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8afb25365681 [remote] Implement Runtime.consoleAPICalled. r=remote-protocol-reviewers,maja_zf
Regressions: 1681855
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
Blocks: 1682076
Component: CDP: Runtime → CDP
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: