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/chrome/browser/ui/activity_services/activity_type_util.h" | 5 #import "ios/chrome/browser/ui/activity_services/activity_type_util.h" |
6 | 6 |
7 #include "ios/chrome/browser/ui/activity_services/appex_constants.h" | 7 #include "ios/chrome/browser/ui/activity_services/appex_constants.h" |
8 #include "ios/chrome/browser/ui/activity_services/print_activity.h" | 8 #include "ios/chrome/browser/ui/activity_services/print_activity.h" |
9 #include "ios/chrome/grit/ios_strings.h" | 9 #include "ios/chrome/grit/ios_strings.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "testing/gtest_mac.h" | 11 #include "testing/gtest_mac.h" |
12 #include "ui/base/l10n/l10n_util_mac.h" | 12 #include "ui/base/l10n/l10n_util_mac.h" |
13 | 13 |
| 14 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 15 #error "This file requires ARC support." |
| 16 #endif |
| 17 |
14 namespace { | 18 namespace { |
15 | 19 |
16 void StringToTypeTestHelper(NSString* activityString, | 20 void StringToTypeTestHelper(NSString* activityString, |
17 activity_type_util::ActivityType expectedType) { | 21 activity_type_util::ActivityType expectedType) { |
18 EXPECT_EQ(activity_type_util::TypeFromString(activityString), expectedType); | 22 EXPECT_EQ(activity_type_util::TypeFromString(activityString), expectedType); |
19 } | 23 } |
20 | 24 |
21 TEST(ActivityTypeUtilTest, StringToTypeTest) { | 25 TEST(ActivityTypeUtilTest, StringToTypeTest) { |
22 StringToTypeTestHelper(@"", activity_type_util::UNKNOWN); | 26 StringToTypeTestHelper(@"", activity_type_util::UNKNOWN); |
23 StringToTypeTestHelper(@"foo", activity_type_util::UNKNOWN); | 27 StringToTypeTestHelper(@"foo", activity_type_util::UNKNOWN); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 @"com.dashlane.dashlanephonefinal.SafariExtension")); | 102 @"com.dashlane.dashlanephonefinal.SafariExtension")); |
99 EXPECT_EQ(activity_services::kPasswordAppExVersionNumber, | 103 EXPECT_EQ(activity_services::kPasswordAppExVersionNumber, |
100 activity_type_util::PasswordAppExActivityVersion( | 104 activity_type_util::PasswordAppExActivityVersion( |
101 @"com.some-company.find-login-action.an-extension")); | 105 @"com.some-company.find-login-action.an-extension")); |
102 EXPECT_NE(activity_services::kPasswordAppExVersionNumber, | 106 EXPECT_NE(activity_services::kPasswordAppExVersionNumber, |
103 activity_type_util::PasswordAppExActivityVersion( | 107 activity_type_util::PasswordAppExActivityVersion( |
104 @"com.apple.UIKit.activity.PostToFacebook")); | 108 @"com.apple.UIKit.activity.PostToFacebook")); |
105 } | 109 } |
106 | 110 |
107 } // namespace | 111 } // namespace |
OLD | NEW |