| OLD | NEW |
| 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/chrome/browser/chrome_url_util.h" | 5 #import "ios/chrome/browser/chrome_url_util.h" |
| 6 | 6 |
| 7 #include "base/macros.h" |
| 7 #include "ios/chrome/browser/chrome_url_constants.h" | 8 #include "ios/chrome/browser/chrome_url_constants.h" |
| 8 #import "net/base/mac/url_conversions.h" | 9 #import "net/base/mac/url_conversions.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 { | 13 namespace { |
| 13 | 14 |
| 14 TEST(ChromeURLUtilTest, TestIsExternalFileReference) { | 15 TEST(ChromeURLUtilTest, TestIsExternalFileReference) { |
| 15 GURL external_url("chrome://external-file/foo/bar"); | 16 GURL external_url("chrome://external-file/foo/bar"); |
| 16 GURL not_external_url("chrome://foo/bar"); | 17 GURL not_external_url("chrome://foo/bar"); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 for (unsigned int i = 0; i < arraysize(kSchemeTestData); ++i) { | 56 for (unsigned int i = 0; i < arraysize(kSchemeTestData); ++i) { |
| 56 const char* url = kSchemeTestData[i]; | 57 const char* url = kSchemeTestData[i]; |
| 57 bool nsurl_result = UrlHasChromeScheme( | 58 bool nsurl_result = UrlHasChromeScheme( |
| 58 [NSURL URLWithString:[NSString stringWithUTF8String:url]]); | 59 [NSURL URLWithString:[NSString stringWithUTF8String:url]]); |
| 59 bool gurl_result = GURL(url).SchemeIs(kChromeUIScheme); | 60 bool gurl_result = GURL(url).SchemeIs(kChromeUIScheme); |
| 60 EXPECT_EQ(gurl_result, nsurl_result) << "Scheme check failed for " << url; | 61 EXPECT_EQ(gurl_result, nsurl_result) << "Scheme check failed for " << url; |
| 61 } | 62 } |
| 62 } | 63 } |
| 63 | 64 |
| 64 } // namespace | 65 } // namespace |
| OLD | NEW |