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

[Screen Wake Lock] Remove web driver set_permission usage #36122

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

marcoscaceres
Copy link
Contributor

@marcoscaceres marcoscaceres commented Sep 28, 2022

Tests for w3c/screen-wake-lock#351

Plus some refactors and removals...


promise_test(t => {
return promise_rejects_dom(t, "NotAllowedError", navigator.wakeLock.request('screen'));
}, "Screen wake lock should not be allowed in dedicated worker");
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove this test?

Copy link
Contributor Author

@marcoscaceres marcoscaceres Sep 29, 2022

Choose a reason for hiding this comment

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

The test was simply wrong (or shouldn't exist). There is nothing in the spec that exposes the API on the WorkerNavigator interface in workers, so running the above would just fail on navigator.wakeLock because .wakeLock is would be undefined.

@@ -1,21 +0,0 @@
// META: script=/resources/testdriver.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Why were these tests rewritten? I generally prefer using window.js tests when testing Javascipt APIs at least in part because tools like clang-format know how to format .js files and not .html files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marcoscaceres
Copy link
Contributor Author

@reillyeon, I find the .js tests really hard to debug and reason about. There is too much magic going on with them building a page around them. It also means I can't just double-click on them and run them locally without also spinning up ./wpt serve.

About formatting, I'd love to get agreement on that... personally, I use prettier as it handles both JS and HTML (as well as great error reporting). I'd love for us to reformat all the tests as a followup.

Copy link
Contributor

@cdumez cdumez left a comment

Choose a reason for hiding this comment

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

LGTM

@marcoscaceres marcoscaceres enabled auto-merge (squash) October 4, 2022 03:35
@cdumez
Copy link
Contributor

cdumez commented Oct 4, 2022

@reillyeon What do you think? Is it ready to merge?

Copy link
Member

@rakuco rakuco left a comment

Choose a reason for hiding this comment

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

@marcoscaceres marcoscaceres changed the title [Screen Wake Lock] Remove web driver request_permission usage [Screen Wake Lock] Remove web driver set_permission usage Oct 4, 2022
@marcoscaceres
Copy link
Contributor Author

I thought this would only be mergeable once the spec was updated accordingly per PULL_REQUEST_TEMPLATE.md and our usual practice? Otherwise we'll end up with tests that do not match what the spec says.

Yes. Unfortunately, I can't merge or now modify the corresponding pull request. @rakuco, as spec Editor, can you take that over (i.e., just delete all the permissions stuff)? We have consensus on removing the permission already, so this shouldn't need to drag longer than a few hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants