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 #include "ios/chrome/browser/web/external_app_launcher.h" | 5 #include "ios/chrome/browser/web/external_app_launcher.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "testing/gtest_mac.h" | 8 #include "testing/gtest_mac.h" |
9 | 9 |
| 10 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 11 #error "This file requires ARC support." |
| 12 #endif |
| 13 |
10 @interface ExternalAppLauncher (Private) | 14 @interface ExternalAppLauncher (Private) |
11 // Returns the Phone/FaceTime call argument from |url|. | 15 // Returns the Phone/FaceTime call argument from |url|. |
12 // Made available for unit testing. | 16 // Made available for unit testing. |
13 + (NSString*)formatCallArgument:(NSURL*)url; | 17 + (NSString*)formatCallArgument:(NSURL*)url; |
14 @end | 18 @end |
15 | 19 |
16 namespace { | 20 namespace { |
17 | 21 |
18 TEST(ExternalAppLauncherTest, TestBadFormatCallArgument) { | 22 TEST(ExternalAppLauncherTest, TestBadFormatCallArgument) { |
19 EXPECT_NSEQ(@"garbage:", | 23 EXPECT_NSEQ(@"garbage:", |
(...skipping 23 matching lines...) Expand all Loading... |
43 } | 47 } |
44 | 48 |
45 TEST(ExternalAppLauncherTest, TestURLEscapedArgument) { | 49 TEST(ExternalAppLauncherTest, TestURLEscapedArgument) { |
46 EXPECT_NSEQ(@"+1 650 555 1212", | 50 EXPECT_NSEQ(@"+1 650 555 1212", |
47 [ExternalAppLauncher | 51 [ExternalAppLauncher |
48 formatCallArgument: | 52 formatCallArgument: |
49 [NSURL URLWithString:@"tel://+1%20650%20555%201212"]]); | 53 [NSURL URLWithString:@"tel://+1%20650%20555%201212"]]); |
50 } | 54 } |
51 | 55 |
52 } // namespace | 56 } // namespace |
OLD | NEW |