Index: ios/net/url_scheme_util_unittest.mm |
diff --git a/ios/net/url_scheme_util_unittest.mm b/ios/net/url_scheme_util_unittest.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e9635cde1f3f09a1c8715da0ce2fb754f688ffcf |
--- /dev/null |
+++ b/ios/net/url_scheme_util_unittest.mm |
@@ -0,0 +1,32 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#import "ios/net/url_scheme_util.h" |
+ |
+#import <Foundation/Foundation.h> |
+ |
+#import "testing/gtest_mac.h" |
+#include "url/gurl.h" |
+ |
+namespace net { |
+ |
+const char* kSchemeTestData[] = { |
+ "http://foo.com", |
+ "https://foo.com", |
+ "data:text/html;charset=utf-8,Hello", |
+ "about:blank", |
+ "chrome://settings", |
+}; |
+ |
+TEST(URLSchemeUtilTest, NSURLHasDataScheme) { |
+ for (unsigned int i = 0; i < arraysize(kSchemeTestData); ++i) { |
+ const char* url = kSchemeTestData[i]; |
+ bool nsurl_result = UrlHasDataScheme( |
+ [NSURL URLWithString:[NSString stringWithUTF8String:url]]); |
+ bool gurl_result = GURL(url).SchemeIs(url::kDataScheme); |
+ EXPECT_EQ(gurl_result, nsurl_result) << "Scheme check failed for " << url; |
+ } |
+} |
+ |
+} // namespace net |