web-platform-tests / wpt

Test suites for Web platform specs — including WHATWG, W3C, and others
https://web-platform-tests.org/
Other
4.98k stars 3.09k forks source link

assertions using {{host}}:{{ports[http][0]}} breaks on wpt.live #35822

Open gsnedders opened 2 years ago

gsnedders commented 2 years ago

See, e.g.,

secure-payment-confirmation/authentication-in-iframe.sub.https.html
75:  assert_equals(result.clientDataJSON.origin, 'https://{{hosts[alt][]}}:{{ports[https][0]}}');

workers/Worker-location.sub.any.js
5:  assert_equals(location.href, 'http://{{host}}:{{ports[http][0]}}/workers/Worker-location.sub.any.worker.js');
6:  assert_equals(location.origin, "http://{{host}}:{{ports[http][0]}}");
8:  assert_equals(location.host, "{{host}}:{{ports[http][0]}}");

portals/portals-host-post-message.sub.html
36:      assert_equals(origin, "http://{{host}}:{{ports[http][0]}}");

js-self-profiling/cross-origin-script-cors.sub.html
18:      assert_equals(trace.resources[0], 'https://{{hosts[alt][]}}:{{ports[https][0]}}/js-self-profiling/resources/profiling-script.js');

reporting/same-origin-cross-site-credentials.https.sub.html
18:      assert_true(location.href.startsWith("https://{{hosts[][]}}:{{ports[https][0]}}/"),

reporting/same-origin-same-site-credentials.https.sub.html
18:      assert_true(location.href.startsWith("https://{{hosts[][]}}:{{ports[https][0]}}/"),

reporting/cross-origin-same-site-credentials.https.sub.html
18:      assert_true(location.href.startsWith("https://{{hosts[][]}}:{{ports[https][0]}}/"),

When running on wpt.live, where the default http port is 80 and https port is 443, these tests will largely fail.

brentfulgham commented 2 years ago

Yes, this led to some confusion on my part when debugging something.