Commit 2b03f5d2 authored by Matt Menke's avatar Matt Menke Committed by Chromium LUCI CQ

Update tests that rely on parsing weird hostnames.

I'm working on gettings things like 127.0.0.0.1, foo.0.1, and,
potentially, foo.1 rejected at the GURL level. This CL updates a
couple tests in advance of that so as to rely on URLs with
hostnames like these being considered valid.

Bug: 1143453
Change-Id: Iae326c3d5df58b6350fd0b89320f7bf64de9e1e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2565196Reviewed-by: default avatarEric Orth <ericorth@chromium.org>
Reviewed-by: default avatarXinghui Lu <xinghuilu@chromium.org>
Reviewed-by: default avatarmark a. foltz <mfoltz@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833106}
parent f1167b4f
......@@ -124,7 +124,7 @@ const char* const kMockCaptivePortalTestUrl =
// page that redirect to the above URL. When connected to the Internet, it
// returns a 204 response.
const char* const kMockCaptivePortal511Url =
"http://mock.captive.portal.511/page511.html";
"http://mock.captive.portal.test/page511.html";
// When behind a captive portal, this URL hangs without committing until a call
// to FailJobs. When that function is called, the request will time out.
......
......@@ -492,8 +492,8 @@ TEST_F(RealTimeUrlLookupServiceTest, TestCanCheckUrl) {
{"http://127.0.0.1:2222/path", false},
{"http://192.168.1.1/path", false},
{"http://172.16.2.2/path", false},
{"http://10.1.1.1/path", false},
{"http://10.1.1.1.1/path", true},
{"http://10.1.1.9/path", false},
{"http://10.1.1.09/path", true},
{"http://example.test/path", true},
{"http://nodothost/path", false},
{"http://x.x/shorthost", false}};
......
......@@ -17,22 +17,22 @@ TEST(GetMediaURLScheme, MissingUnknown) {
TEST(GetMediaURLScheme, WebCommon) {
EXPECT_EQ(media::mojom::MediaURLScheme::kFtp,
GetMediaURLScheme(KURL("ftp://abc.123")));
GetMediaURLScheme(KURL("ftp://abc.test")));
EXPECT_EQ(media::mojom::MediaURLScheme::kHttp,
GetMediaURLScheme(KURL("http://abc.123")));
GetMediaURLScheme(KURL("http://abc.test")));
EXPECT_EQ(media::mojom::MediaURLScheme::kHttps,
GetMediaURLScheme(KURL("https://abc.123")));
GetMediaURLScheme(KURL("https://abc.test")));
EXPECT_EQ(media::mojom::MediaURLScheme::kData,
GetMediaURLScheme(KURL("data://abc.123")));
GetMediaURLScheme(KURL("data://abc.test")));
EXPECT_EQ(media::mojom::MediaURLScheme::kBlob,
GetMediaURLScheme(KURL("blob://abc.123")));
GetMediaURLScheme(KURL("blob://abc.test")));
EXPECT_EQ(media::mojom::MediaURLScheme::kJavascript,
GetMediaURLScheme(KURL("javascript://abc.123")));
GetMediaURLScheme(KURL("javascript://abc.test")));
}
TEST(GetMediaURLScheme, Files) {
EXPECT_EQ(media::mojom::MediaURLScheme::kFile,
GetMediaURLScheme(KURL("file://abc.123")));
GetMediaURLScheme(KURL("file://abc.test")));
EXPECT_EQ(media::mojom::MediaURLScheme::kFileSystem,
GetMediaURLScheme(KURL("filesystem:file://abc/123")));
}
......
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