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

Side by Side Diff: ios/net/url_scheme_util_unittest.mm

Issue 1544743002: Switch to standard integer types in ios/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/net/url_scheme_util.h" 5 #import "ios/net/url_scheme_util.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #include "base/macros.h"
9 #import "testing/gtest_mac.h" 10 #import "testing/gtest_mac.h"
10 #include "url/gurl.h" 11 #include "url/gurl.h"
11 12
12 namespace net { 13 namespace net {
13 14
14 const char* kSchemeTestData[] = { 15 const char* kSchemeTestData[] = {
15 "http://foo.com", 16 "http://foo.com",
16 "https://foo.com", 17 "https://foo.com",
17 "data:text/html;charset=utf-8,Hello", 18 "data:text/html;charset=utf-8,Hello",
18 "about:blank", 19 "about:blank",
19 "chrome://settings", 20 "chrome://settings",
20 }; 21 };
21 22
22 TEST(URLSchemeUtilTest, NSURLHasDataScheme) { 23 TEST(URLSchemeUtilTest, NSURLHasDataScheme) {
23 for (unsigned int i = 0; i < arraysize(kSchemeTestData); ++i) { 24 for (unsigned int i = 0; i < arraysize(kSchemeTestData); ++i) {
24 const char* url = kSchemeTestData[i]; 25 const char* url = kSchemeTestData[i];
25 bool nsurl_result = UrlHasDataScheme( 26 bool nsurl_result = UrlHasDataScheme(
26 [NSURL URLWithString:[NSString stringWithUTF8String:url]]); 27 [NSURL URLWithString:[NSString stringWithUTF8String:url]]);
27 bool gurl_result = GURL(url).SchemeIs(url::kDataScheme); 28 bool gurl_result = GURL(url).SchemeIs(url::kDataScheme);
28 EXPECT_EQ(gurl_result, nsurl_result) << "Scheme check failed for " << url; 29 EXPECT_EQ(gurl_result, nsurl_result) << "Scheme check failed for " << url;
29 } 30 }
30 } 31 }
31 32
32 } // namespace net 33 } // namespace net
OLDNEW
« no previous file with comments | « ios/net/request_tracker.h ('k') | ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698