Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Unified Diff: src/gurl_unittest.cc

Issue 10542140: Fix handling of URLs with no schema. (Closed) Base URL: http://git.chromium.org/external/google-url.git@master
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/url_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gurl_unittest.cc
diff --git a/src/gurl_unittest.cc b/src/gurl_unittest.cc
index f62267ff981627833df4ea3e1b5d70361d2e4498..23a5c45d9db8681d492da6ed7d149fdc2c05171f 100644
--- a/src/gurl_unittest.cc
+++ b/src/gurl_unittest.cc
@@ -182,6 +182,12 @@ TEST(GURLTest, Invalid) {
EXPECT_EQ("", url.ref());
}
+TEST(GURLTest, NonURL) {
+ GURL url("random");
+ EXPECT_FALSE(url.is_valid());
+ EXPECT_EQ("random", url.possibly_invalid_spec());
+}
+
TEST(GURLTest, Resolve) {
// The tricky cases for relative URL resolving are tested in the
// canonicalizer unit test. Here, we just test that the GURL integration
« no previous file with comments | « no previous file | src/url_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698