Commit 34cab752 authored by Douglas Creager's avatar Douglas Creager Committed by Commit Bot

Handle "nonexistent" WPT subdomains correctly

WPT provides a "nonexistent" subdomain that it guarantees will never
resolve to any IP address [1].  Our test harness doesn't rely on
/etc/hosts to resolve these test domains, and uses rewrite rules
internally instead.  Those rewrite rules were blindly resolving all
*.test domains to 127.0.0.1; this patch adds an additional rule that
handles the nonexistent subdomain correctly.

[1] https://web-platform-tests.org/writing-tests/server-features.html#tests-involving-multiple-origins

Bug: 866003
Change-Id: I4e331490d56872b8dfc4db25973291ea6e099565
Reviewed-on: https://chromium-review.googlesource.com/1145487
Commit-Queue: Douglas Creager <dcreager@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577505}
parent 54339ac9
......@@ -248,6 +248,7 @@ bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
command_line.AppendSwitch(switches::kEnablePreciseMemoryInfo);
command_line.AppendSwitchASCII(network::switches::kHostResolverRules,
"MAP nonexistent.*.test ~NOTFOUND,"
"MAP *.test 127.0.0.1");
command_line.AppendSwitch(switches::kEnablePartialRaster);
......
This is a testharness.js-based test.
PASS HTTP protocol, no subdomain, port #1
PASS HTTP protocol, no subdomain, port #2
PASS HTTP protocol, www subdomain #1, port #1
PASS HTTP protocol, www subdomain #1, port #2
PASS HTTP protocol, www subdomain #2, port #1
PASS HTTP protocol, www subdomain #2, port #2
PASS HTTP protocol, www subdomain #3, port #1
PASS HTTP protocol, www subdomain #3, port #2
PASS HTTP protocol, punycode subdomain #1, port #1
PASS HTTP protocol, punycode subdomain #1, port #2
PASS HTTP protocol, punycode subdomain #2, port #1
PASS HTTP protocol, punycode subdomain #2, port #2
FAIL HTTP protocol, non-existent domain, port #1 assert_false: expected false got true
FAIL HTTP protocol, non-existent domain, port #2 assert_false: expected false got true
PASS HTTPS protocol, no subdomain
PASS HTTPS protocol, www subdomain #1
PASS HTTPS protocol, www subdomain #2
PASS HTTPS protocol, www subdomain #3
PASS HTTPS protocol, punycode subdomain #1
PASS HTTPS protocol, punycode subdomain #2
PASS HTTPS protocol, non-existent domain, port #1
PASS HTTPS protocol, non-existent domain, port #2
Harness: the test ran to completion.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment