Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Bypass log settings for support dump #6654

Conversation

joeyparrish
Copy link
Member

Karma creates a dump() function on the context window that we can use to log something to the console without respect for the normal captureConsole setting. Use this for the output of probeSupport(), so we always have it in CI logs.

Karma creates a dump() function on the context window that we can use
to log something to the console without respect for the normal
captureConsole setting.  Use this for the output of probeSupport(), so
we always have it in CI logs.
Copy link

@alekzz alekzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work for every browser? I see only Firefox support here https://developer.mozilla.org/en-US/docs/Web/API/Window/dump.

@joeyparrish
Copy link
Member Author

Does it work for every browser? I see only Firefox support here https://developer.mozilla.org/en-US/docs/Web/API/Window/dump.

Yes, because it doesn't use that, it uses a conflictingly-named method created at runtime by Karma:

https://github.com/joeyparrish/karma/blob/d8cf806e776158898c3c811ad20e16d3d0dbce87/static/context.js#L222-L224

    contextWindow.dump = function () {
      self.log('dump', arguments)
    }

In the flattened environment, there is only one window within Karma, so contextWindow == window.

@joeyparrish
Copy link
Member Author

You can see the results already in the CI logs for this PR:

https://github.com/shaka-project/shaka-player/actions/runs/9198874232/job/25302574461?pr=6654

@shaka-bot
Copy link
Collaborator

Incremental code coverage: No instrumented code was changed.

@joeyparrish joeyparrish merged commit 7ab0691 into shaka-project:main May 22, 2024
20 checks passed
@joeyparrish joeyparrish deleted the bypass-log-settings-for-support-dump branch May 22, 2024 23:58
joeyparrish added a commit that referenced this pull request May 31, 2024
Karma creates a dump() function on the context window that we can use to
log something to the console without respect for the normal
captureConsole setting. Use this for the output of probeSupport(), so we
always have it in CI logs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants