1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #import "ios/net/url_scheme_util.h"
7 #import <Foundation/Foundation.h>
9 #import "testing/gtest_mac.h"
14 const char* kSchemeTestData[] = {
17 "data:text/html;charset=utf-8,Hello",
22 TEST(URLSchemeUtilTest, NSURLHasDataScheme) {
23 for (unsigned int i = 0; i < arraysize(kSchemeTestData); ++i) {
24 const char* url = kSchemeTestData[i];
25 bool nsurl_result = UrlHasDataScheme(
26 [NSURL URLWithString:[NSString stringWithUTF8String:url]]);
27 bool gurl_result = GURL(url).SchemeIs(url::kDataScheme);
28 EXPECT_EQ(gurl_result, nsurl_result) << "Scheme check failed for " << url;