| 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/native_app_launcher/native_app_infobar_delegate.h" | 5 #import "ios/chrome/browser/native_app_launcher/native_app_infobar_delegate.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #import "ios/public/provider/chrome/browser/native_app_launcher/native_app_types
.h" | 10 #import "ios/public/provider/chrome/browser/native_app_launcher/native_app_types
.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "testing/platform_test.h" | 12 #include "testing/platform_test.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 class NativeAppInfoBarDelegateTest : public PlatformTest {}; | 20 class NativeAppInfoBarDelegateTest : public PlatformTest {}; |
| 17 | 21 |
| 18 TEST_F(NativeAppInfoBarDelegateTest, TestIdentifiers) { | 22 TEST_F(NativeAppInfoBarDelegateTest, TestIdentifiers) { |
| 19 std::unique_ptr<NativeAppInfoBarDelegate> delegate; | 23 std::unique_ptr<NativeAppInfoBarDelegate> delegate; |
| 20 | 24 |
| 21 delegate = base::MakeUnique<NativeAppInfoBarDelegate>( | 25 delegate = base::MakeUnique<NativeAppInfoBarDelegate>( |
| 22 nil, GURL(), NATIVE_APP_INSTALLER_CONTROLLER); | 26 nil, GURL(), NATIVE_APP_INSTALLER_CONTROLLER); |
| 23 EXPECT_EQ(infobars::InfoBarDelegate::InfoBarIdentifier:: | 27 EXPECT_EQ(infobars::InfoBarDelegate::InfoBarIdentifier:: |
| 24 NATIVE_APP_INSTALLER_INFOBAR_DELEGATE, | 28 NATIVE_APP_INSTALLER_INFOBAR_DELEGATE, |
| 25 delegate->GetIdentifier()); | 29 delegate->GetIdentifier()); |
| 26 | 30 |
| 27 delegate = base::MakeUnique<NativeAppInfoBarDelegate>( | 31 delegate = base::MakeUnique<NativeAppInfoBarDelegate>( |
| 28 nil, GURL(), NATIVE_APP_LAUNCHER_CONTROLLER); | 32 nil, GURL(), NATIVE_APP_LAUNCHER_CONTROLLER); |
| 29 EXPECT_EQ(infobars::InfoBarDelegate::InfoBarIdentifier:: | 33 EXPECT_EQ(infobars::InfoBarDelegate::InfoBarIdentifier:: |
| 30 NATIVE_APP_LAUNCHER_INFOBAR_DELEGATE, | 34 NATIVE_APP_LAUNCHER_INFOBAR_DELEGATE, |
| 31 delegate->GetIdentifier()); | 35 delegate->GetIdentifier()); |
| 32 | 36 |
| 33 delegate = base::MakeUnique<NativeAppInfoBarDelegate>( | 37 delegate = base::MakeUnique<NativeAppInfoBarDelegate>( |
| 34 nil, GURL(), NATIVE_APP_OPEN_POLICY_CONTROLLER); | 38 nil, GURL(), NATIVE_APP_OPEN_POLICY_CONTROLLER); |
| 35 EXPECT_EQ(infobars::InfoBarDelegate::InfoBarIdentifier:: | 39 EXPECT_EQ(infobars::InfoBarDelegate::InfoBarIdentifier:: |
| 36 NATIVE_APP_OPEN_POLICY_INFOBAR_DELEGATE, | 40 NATIVE_APP_OPEN_POLICY_INFOBAR_DELEGATE, |
| 37 delegate->GetIdentifier()); | 41 delegate->GetIdentifier()); |
| 38 } | 42 } |
| 39 | 43 |
| 40 } // namespace | 44 } // namespace |
| OLD | NEW |