OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/web/navigation/navigation_item_impl.h" | 5 #import "ios/web/navigation/navigation_item_impl.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #import "base/mac/scoped_nsobject.h" | |
11 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
13 #import "testing/gtest_mac.h" | 12 #import "testing/gtest_mac.h" |
14 #include "testing/platform_test.h" | 13 #include "testing/platform_test.h" |
15 | 14 |
| 15 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 16 #error "This file requires ARC support." |
| 17 #endif |
| 18 |
16 namespace web { | 19 namespace web { |
17 namespace { | 20 namespace { |
18 | 21 |
19 const char kItemURLString[] = "http://init.test"; | 22 const char kItemURLString[] = "http://init.test"; |
20 static NSString* const kHTTPHeaderKey1 = @"key1"; | 23 static NSString* const kHTTPHeaderKey1 = @"key1"; |
21 static NSString* const kHTTPHeaderKey2 = @"key2"; | 24 static NSString* const kHTTPHeaderKey2 = @"key2"; |
22 static NSString* const kHTTPHeaderValue1 = @"value1"; | 25 static NSString* const kHTTPHeaderValue1 = @"value1"; |
23 static NSString* const kHTTPHeaderValue2 = @"value2"; | 26 static NSString* const kHTTPHeaderValue2 = @"value2"; |
24 | 27 |
25 class NavigationItemTest : public PlatformTest { | 28 class NavigationItemTest : public PlatformTest { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 162 |
160 title = NavigationItemImpl::GetDisplayTitleForURL(GURL("file://foo.org/")); | 163 title = NavigationItemImpl::GetDisplayTitleForURL(GURL("file://foo.org/")); |
161 EXPECT_EQ("file://foo.org/", base::UTF16ToUTF8(title)); | 164 EXPECT_EQ("file://foo.org/", base::UTF16ToUTF8(title)); |
162 | 165 |
163 title = NavigationItemImpl::GetDisplayTitleForURL(GURL("file://foo/1.gz")); | 166 title = NavigationItemImpl::GetDisplayTitleForURL(GURL("file://foo/1.gz")); |
164 EXPECT_EQ("1.gz", base::UTF16ToUTF8(title)); | 167 EXPECT_EQ("1.gz", base::UTF16ToUTF8(title)); |
165 } | 168 } |
166 | 169 |
167 } // namespace | 170 } // namespace |
168 } // namespace web | 171 } // namespace web |
OLD | NEW |