-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Update tests for NavigatorID #3881
Conversation
Reviewers for this pull request are: @Ms2ger, @ayg, @gsnedders, @jdm, @jgraham, @plehegar, @sideshowbarker, @zcorpan, and @zqzhang. |
How should the NavigatorID.worker.js variant be run? I think there'll be lots of failures, and I wanted to use that to maybe change the spec again. |
For the window tests, I have verified that they all pass, except for Edge failing on the navigator.vendor test, where I expect "Google Inc." If this PR is merged I'll file an Edge issue to see if they'd go along with this. If not, another compatibility mode would be needed. |
You may want to check if workers/interfaces/WorkerUtils/navigator/window-only.worker.js is redundant now. |
Oh, so wptserve does it, filed https://crbug.com/653514 window-only.worker.js is indeed now redundant, will remove. |
In http://w3c-test.org/submissions/3881/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.worker, these tests fail:
Inverted:
Edit: The PR has changed since, the above will not reproduce. |
Tests: web-platform-tests/wpt#3881 Attempting to write tests for the current spec revealed that product was already exposed in all engines, and appCodeName in all but Edge. This leaves productSub, vendor and vendorSub restricted, where there is a 2/2 split between engines. Follow up to #216.
I've submitted a spec PR to expose |
06546bf
to
ade9e8c
Compare
This will leave Edge and WebKit with failures, will file bugs when spec and tests are merged. |
@domenic, can you review? |
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=27820 | ||
|
||
test(function() { | ||
if ("window" in self && navigator.userAgent.indexOf("WebKit") == -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file uses several different ways of testing navigator compatibility mode, not all of which are compatible. E.g. here Gecko means "does not have the string WebKit", where above Gecko means "does not have the string WebKit or the string Chrome".
It would be good to factor this out into a variable (in the test file) that is one of "Chrome", "WebKit", or "Gecko", and then the test code proper could say if ("window" in self && navigatorCompatibilityMode === "Gecko")
. Then you wouldn't need the spec quotes as much.
// Otherwise it should exist and return false. | ||
else { | ||
assert_false(navigator.taintEnabled()); | ||
if (navigator.userAgent.indexOf("Chrome") != -1 || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this could be navigator.userAgent.includes("Chrome")
for clarity.
Aligns with these spec changes:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27796
whatwg/html#78
whatwg/html#199
whatwg/html#207
whatwg/html#220
whatwg/html#1017
whatwg/html#1870