Open Bug 1672323 Opened 4 years ago Updated 7 months ago

Create a WPT test to verify handling of locahost and *.locahost

Categories

(Core :: Networking: DNS, task, P3)

task

Tracking

()

People

(Reporter: fredw, Unassigned)

References

Details

(Whiteboard: [necko-triaged])

In bug 1220810, we are adding tests to check that locahost and *.localhost are Potentially Trustworthy
dom/security/test/gtest/TestSecureContext.cpp
dom/security/test/unit/test_isOriginPotentiallyTrustworthy.js

It does not seem the change affects the WPT results and I can only find internal tests at
https://chromium-review.googlesource.com/c/chromium/src/+/598068/
https://chromium-review.googlesource.com/c/chromium/src/+/2002584

I'm not yet sure whether there is something that makes testing this in WPT difficult, but I'm opening this bug for the record.

If you want to mimic the Chrome tests I don't know if WPT is the best option here.
The easiest would be to go for xpcshell-tests like this one: https://searchfox.org/mozilla-central/source/netwerk/test/unit/test_dns_override.js

Basically you'd add an override for localhost/something.localhost, resolve them and make sure they still resolve to 127.0.0.1 or ::1

Do you want to take the bug?

Severity: -- → S3
Flags: needinfo?(fred.wang)
Priority: -- → P2
Whiteboard: [necko-triaged]

@Valentin: Testing that the *.localhost and localhost are potentially trustworthy is already done internally:

dom/security/test/gtest/TestSecureContext.cpp
dom/security/test/unit/test_isOriginPotentiallyTrustworthy.js

I agree, we can also add a test to ensure they really redirect to 127.0.0.1 or ::1 ; and yes I can give a try and do that in a separate bug.

The main reason why I opened this bug is because it's required by https://wiki.mozilla.org/ExposureGuidelines#Intent_to_prototype

web-platform-tests: Please link to the test suite. If any part of the feature is not tested by web-platform-tests, or if you had to write gecko-only tests for parts of the feature, please include links to one or more of:

A web-platform-tests issue explaining why a certain thing cannot be tested (example).
A spec issue for some change that would make it possible to test (example).
A Bugzilla bug for the creating web-platform-tests.

But I haven't investigate how difficult it would be.

Flags: needinfo?(fred.wang)

Ok, that's fair. Thanks for doing this btw!

Changing the title to make this a bit broader.

More tests are added in bug 1673315 (as per comment 1) but this is still internal.

Depends on: 1673315
Summary: Create a WPT test to verify that locahost and *.locahost are Potentially Trustworthy → Create a WPT test to verify handling of locahost and *.locahost
Priority: P2 → P3
No longer blocks: 1488740
Depends on: 1488740
You need to log in before you can comment on or make changes to this bug.