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

feat: Allow inspection of specific shared workers #19793

Closed
wants to merge 8 commits into from

Conversation

JohnPop117
Copy link

@JohnPop117 JohnPop117 commented Aug 16, 2019

Description of Change

Added APIs to allow electron to get a list of shared web workers and then inspect
a shared worker based on its ID.

Checklist

Release Notes

Notes: Added ability to inspect specific shared workers

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Aug 16, 2019
@miniak
Copy link
Contributor

miniak commented Aug 16, 2019

@JohnPop117 please add the release notes

contents[0].once('devtools-closed', () => {
done()
})
contents[0].inspectSharedWorkerById(vectorOfWorkers[0].id)
Copy link
Contributor

Choose a reason for hiding this comment

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

This assumes that vectorOfWorkers has been initialized before running this test.
Please make the test self-contained.

Copy link
Contributor

Choose a reason for hiding this comment

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

This test will still fail if the previous test hasn't been run. Tests should not depend on each other. Please make vectorOfWorkers a local variable of each test.

And please avoid using the word "vector", this concept doesn't exist in JavaScript. It's ok to call it simply sharedWorkers.

spec/api-web-contents-spec.js Outdated Show resolved Hide resolved
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Aug 17, 2019
})

it('can inspect a specific shared worker', (done) => {
const contents = webContents.getAllWebContents()
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be const contents = remote.getCurrentWebContents().

Copy link
Contributor

@alexeykuzmin alexeykuzmin left a comment

Choose a reason for hiding this comment

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

Looks good expect that one tests issue (see above).

@JohnPop117 JohnPop117 requested review from a team as code owners August 23, 2019 16:52
@alexeykuzmin
Copy link
Contributor

@JohnPop117

/home/builduser/project/src/electron/spec/api-web-contents-spec.js
  1295:1  error  Trailing spaces not allowed  no-trailing-spaces

@jkleinsc
Copy link
Contributor

@JohnPop117 can you rebase this PR against the latest from master?

Copy link
Contributor

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

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

Needs rebase from master

@MarshallOfSound
Copy link
Member

This appears to have had a bad rebase

Copy link
Contributor

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

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

Thanks for rebasing - much easier to see the changes now! Can we enable the new test?

spec/api-web-contents-spec.js Outdated Show resolved Hide resolved
docs/api/web-contents.md Outdated Show resolved Hide resolved
docs/api/structures/shared-worker-info.md Outdated Show resolved Hide resolved
@jkleinsc
Copy link
Contributor

jkleinsc commented Sep 5, 2019

@JohnPop117 can you check and see if you are following your fork on CircleCI? For some reason CircleCI builds are not being triggered and according to this article if you are following the project fork on their personal account rather than the project itself on CircleCI, builds will not be triggered:
https://support.circleci.com/hc/en-us/articles/360008097173?input_string=pull+request+from+fork+not+triggering+builds

@miniak
Copy link
Contributor

miniak commented Oct 1, 2019

Taking over due to lack of activity. This PR is not a personal contribution, but MS one. Replacement PR #20389

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

5 participants