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

Unified Diff: ios/net/url_scheme_util_unittest.mm

Issue 994823004: [iOS] Upstream //ios/net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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
« ios/net/clients/crn_forwarding_network_client_factory.h ('K') | « ios/net/url_scheme_util.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698