Commit 35fad07f authored by Stephen McGruer's avatar Stephen McGruer Committed by Commit Bot

[Cleanup] Fix test name to properly reflect what it tests

This is a follow up from
https://chromium-review.googlesource.com/c/chromium/src/+/1297172

Bug: None
Change-Id: I9db0d1a3bb233a49938ab9be4813fe3cbf0505af
Reviewed-on: https://chromium-review.googlesource.com/c/1340871
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610057}
parent ba1bbee0
...@@ -771,7 +771,10 @@ TEST(GURLTest, SchemeIsBlob) { ...@@ -771,7 +771,10 @@ TEST(GURLTest, SchemeIsBlob) {
EXPECT_FALSE(GURL("http://bar/").SchemeIsBlob()); EXPECT_FALSE(GURL("http://bar/").SchemeIsBlob());
} }
TEST(GURLTest, ContentAndPathForNonStandardURLs) { // Tests that the 'content' of the URL is properly extracted. This can be
// complex in cases such as multiple schemes (view-source:http:) or for
// javascript URLs. See GURL::GetContent for more details.
TEST(GURLTest, ContentForNonStandardURLs) {
struct TestCase { struct TestCase {
const char* url; const char* url;
const char* expected; const char* expected;
...@@ -779,12 +782,18 @@ TEST(GURLTest, ContentAndPathForNonStandardURLs) { ...@@ -779,12 +782,18 @@ TEST(GURLTest, ContentAndPathForNonStandardURLs) {
{"null", ""}, {"null", ""},
{"not-a-standard-scheme:this is arbitrary content", {"not-a-standard-scheme:this is arbitrary content",
"this is arbitrary content"}, "this is arbitrary content"},
// When there are multiple schemes, only the first is excluded from the
// content. Note also that for e.g. 'http://', the '//' is part of the
// content not the scheme.
{"view-source:http://example.com/path", "http://example.com/path"}, {"view-source:http://example.com/path", "http://example.com/path"},
{"blob:http://example.com/GUID", "http://example.com/GUID"}, {"blob:http://example.com/GUID", "http://example.com/GUID"},
{"blob://http://example.com/GUID", "//http://example.com/GUID"}, {"blob://http://example.com/GUID", "//http://example.com/GUID"},
{"blob:http://user:password@example.com/GUID", {"blob:http://user:password@example.com/GUID",
"http://user:password@example.com/GUID"}, "http://user:password@example.com/GUID"},
// The octothorpe character ('#') marks the end of the URL content, and
// the start of the fragment. It should not be included in the content.
{"http://www.example.com/GUID#ref", "www.example.com/GUID"}, {"http://www.example.com/GUID#ref", "www.example.com/GUID"},
{"http://me:secret@example.com/GUID/#ref", "me:secret@example.com/GUID/"}, {"http://me:secret@example.com/GUID/#ref", "me:secret@example.com/GUID/"},
{"data:text/html,Question?<div style=\"color: #bad\">idea</div>", {"data:text/html,Question?<div style=\"color: #bad\">idea</div>",
...@@ -804,6 +813,9 @@ TEST(GURLTest, ContentAndPathForNonStandardURLs) { ...@@ -804,6 +813,9 @@ TEST(GURLTest, ContentAndPathForNonStandardURLs) {
} }
} }
// Tests that the URL path is properly extracted for unusual URLs. This can be
// complex in cases such as multiple schemes (view-source:http:) or when
// octothorpes ('#') are involved.
TEST(GURLTest, PathForNonStandardURLs) { TEST(GURLTest, PathForNonStandardURLs) {
struct TestCase { struct TestCase {
const char* url; const char* url;
......
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