diff options
Diffstat (limited to 'url')
-rw-r--r-- | url/gurl.h | 5 | ||||
-rw-r--r-- | url/gurl_unittest.cc | 6 |
2 files changed, 11 insertions, 0 deletions
@@ -236,6 +236,11 @@ class URL_EXPORT GURL { (SchemeIsFileSystem() && inner_url() && inner_url()->SchemeIsSecure()); } + // Returns true if the scheme is "blob". + bool SchemeIsBlob() const { + return SchemeIs(url::kBlobScheme); + } + // The "content" of the URL is everything after the scheme (skipping the // scheme delimiting colon). It is an error to get the origin of an invalid // URL. The result will be an empty string. diff --git a/url/gurl_unittest.cc b/url/gurl_unittest.cc index 489b9d2..f38d7f9 100644 --- a/url/gurl_unittest.cc +++ b/url/gurl_unittest.cc @@ -635,4 +635,10 @@ TEST(GURLTest, SchemeIsWSOrWSS) { EXPECT_FALSE(GURL("http://bar/").SchemeIsWSOrWSS()); } +TEST(GURLTest, SchemeIsBlob) { + EXPECT_TRUE(GURL("BLOB://BAR/").SchemeIsBlob()); + EXPECT_TRUE(GURL("blob://bar/").SchemeIsBlob()); + EXPECT_FALSE(GURL("http://bar/").SchemeIsBlob()); +} + } // namespace url |