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 #ifndef CHROME_BROWSER_UI_COCOA_PASSWORDS_BASE_PASSWORDS_CONTROLLER_TEST_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PASSWORDS_BASE_PASSWORDS_CONTROLLER_TEST_H_ |
6 #define CHROME_BROWSER_UI_COCOA_PASSWORDS_BASE_PASSWORDS_CONTROLLER_TEST_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PASSWORDS_BASE_PASSWORDS_CONTROLLER_TEST_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
11 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 11 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
12 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 12 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
13 #import "chrome/browser/ui/cocoa/passwords/base_passwords_content_view_controlle
r.h" | 13 #import "chrome/browser/ui/cocoa/passwords/base_passwords_content_view_controlle
r.h" |
14 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" | 14 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
15 #include "chrome/browser/ui/passwords/passwords_model_delegate_mock.h" | 15 #include "chrome/browser/ui/passwords/passwords_model_delegate_mock.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class WebContents; | 18 class WebContents; |
19 } // namespace content | 19 } // namespace content |
20 class PasswordsModelDelegateMock; | 20 class PasswordsModelDelegateMock; |
21 | 21 |
22 // Helper delegate for testing the views of the password management bubble. | 22 // Helper delegate for testing the views of the password management bubble. |
23 @interface ContentViewDelegateMock : NSObject<BasePasswordsContentViewDelegate> | 23 @interface ContentViewDelegateMock : NSObject<BasePasswordsContentViewDelegate> |
24 @property(nonatomic) ManagePasswordsBubbleModel* model; | 24 @property(nonatomic) ManagePasswordsBubbleModel* model; |
25 @property(readonly, nonatomic) BOOL dismissed; | 25 @property(readonly, nonatomic) BOOL dismissed; |
26 @end | 26 @end |
27 | 27 |
28 class ManagePasswordsControllerTest : public CocoaProfileTest { | 28 class ManagePasswordsControllerTest : public CocoaProfileTest { |
29 public: | 29 public: |
30 using VectorConstFormPtr = std::vector<const autofill::PasswordForm*>; | 30 using VectorConstFormPtr = |
| 31 std::vector<std::unique_ptr<autofill::PasswordForm>>; |
31 | 32 |
32 ManagePasswordsControllerTest(); | 33 ManagePasswordsControllerTest(); |
33 ~ManagePasswordsControllerTest() override; | 34 ~ManagePasswordsControllerTest() override; |
34 void SetUp() override; | 35 void SetUp() override; |
35 | 36 |
36 PasswordsModelDelegateMock* ui_controller() { | 37 PasswordsModelDelegateMock* ui_controller() { |
37 return ui_controller_.get(); | 38 return ui_controller_.get(); |
38 } | 39 } |
39 ContentViewDelegateMock* delegate() { return delegate_.get(); } | 40 ContentViewDelegateMock* delegate() { return delegate_.get(); } |
40 ManagePasswordsBubbleModel* GetModelAndCreateIfNull(); | 41 ManagePasswordsBubbleModel* GetModelAndCreateIfNull(); |
(...skipping 11 matching lines...) Expand all Loading... |
52 private: | 53 private: |
53 std::unique_ptr<PasswordsModelDelegateMock> ui_controller_; | 54 std::unique_ptr<PasswordsModelDelegateMock> ui_controller_; |
54 std::unique_ptr<content::WebContents> test_web_contents_; | 55 std::unique_ptr<content::WebContents> test_web_contents_; |
55 std::unique_ptr<ManagePasswordsBubbleModel> model_; | 56 std::unique_ptr<ManagePasswordsBubbleModel> model_; |
56 base::scoped_nsobject<ContentViewDelegateMock> delegate_; | 57 base::scoped_nsobject<ContentViewDelegateMock> delegate_; |
57 | 58 |
58 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsControllerTest); | 59 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsControllerTest); |
59 }; | 60 }; |
60 | 61 |
61 #endif // CHROME_BROWSER_UI_COCOA_PASSWORDS_BASE_PASSWORDS_CONTROLLER_TEST_H_ | 62 #endif // CHROME_BROWSER_UI_COCOA_PASSWORDS_BASE_PASSWORDS_CONTROLLER_TEST_H_ |
OLD | NEW |