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_controller.h" | 5 #import "ios/chrome/browser/native_app_launcher/native_app_infobar_controller.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.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 "ios/chrome/browser/native_app_launcher/native_app_infobar_delegate.h" | 11 #include "ios/chrome/browser/native_app_launcher/native_app_infobar_delegate.h" |
12 #import "ios/chrome/browser/native_app_launcher/native_app_navigation_controller
_protocol.h" | 12 #import "ios/chrome/browser/native_app_launcher/native_app_navigation_controller
_protocol.h" |
13 #include "testing/platform_test.h" | 13 #include "testing/platform_test.h" |
14 | 14 |
| 15 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 16 #error "This file requires ARC support." |
| 17 #endif |
| 18 |
15 @interface NativeAppInfoBarController (Testing) | 19 @interface NativeAppInfoBarController (Testing) |
16 - (void)infoBarButtonDidPress:(UIButton*)button; | 20 - (void)infoBarButtonDidPress:(UIButton*)button; |
17 - (void)setInfoBarDelegate:(NativeAppInfoBarDelegate*)delegate; | 21 - (void)setInfoBarDelegate:(NativeAppInfoBarDelegate*)delegate; |
18 @end | 22 @end |
19 | 23 |
20 namespace { | 24 namespace { |
21 | 25 |
22 class NativeAppInfoBarControllerTest : public PlatformTest { | 26 class NativeAppInfoBarControllerTest : public PlatformTest { |
23 class MockNativeAppInfoBarDelegate : public NativeAppInfoBarDelegate { | 27 class MockNativeAppInfoBarDelegate : public NativeAppInfoBarDelegate { |
24 public: | 28 public: |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } | 96 } |
93 | 97 |
94 TEST_F(NativeAppInfoBarControllerTest, TestActionsWithOpenPolicyInfoBar) { | 98 TEST_F(NativeAppInfoBarControllerTest, TestActionsWithOpenPolicyInfoBar) { |
95 SetUpWithType(NATIVE_APP_OPEN_POLICY_CONTROLLER); | 99 SetUpWithType(NATIVE_APP_OPEN_POLICY_CONTROLLER); |
96 ExpectUserPerformedAction(NATIVE_APP_ACTION_CLICK_ONCE); | 100 ExpectUserPerformedAction(NATIVE_APP_ACTION_CLICK_ONCE); |
97 ExpectUserPerformedAction(NATIVE_APP_ACTION_CLICK_ALWAYS); | 101 ExpectUserPerformedAction(NATIVE_APP_ACTION_CLICK_ALWAYS); |
98 ExpectUserPerformedAction(NATIVE_APP_ACTION_DISMISS); | 102 ExpectUserPerformedAction(NATIVE_APP_ACTION_DISMISS); |
99 } | 103 } |
100 | 104 |
101 } // namespace | 105 } // namespace |
OLD | NEW |