Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2249)

Unified Diff: chrome/browser/ui/cocoa/passwords/base_passwords_controller_test.h

Issue 2040143006: Implement the Sync promo in the password bubble on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/passwords/base_passwords_controller_test.h
diff --git a/chrome/browser/ui/cocoa/passwords/base_passwords_controller_test.h b/chrome/browser/ui/cocoa/passwords/base_passwords_controller_test.h
index 9a802e7e26e9242476ec0399e3c659809423c085..7153b8905ce0a371f85112794a49eee6979e79ec 100644
--- a/chrome/browser/ui/cocoa/passwords/base_passwords_controller_test.h
+++ b/chrome/browser/ui/cocoa/passwords/base_passwords_controller_test.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_COCOA_PASSWORDS_BASE_PASSWORDS_CONTROLLER_TEST_H_
#define CHROME_BROWSER_UI_COCOA_PASSWORDS_BASE_PASSWORDS_CONTROLLER_TEST_H_
+#include "base/mac/scoped_nsobject.h"
#include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
#include "chrome/browser/ui/cocoa/cocoa_test_helper.h"
#import "chrome/browser/ui/cocoa/passwords/base_passwords_content_view_controller.h"
@@ -17,20 +18,29 @@ class WebContents;
class ManagePasswordsUIControllerMock;
class ManagePasswordsBubbleModel;
+// Helper delegate for testing the views of the password management bubble.
+@interface ContentViewDelegateMock : NSObject<BasePasswordsContentViewDelegate>
+@property(nonatomic) ManagePasswordsBubbleModel* model;
+@property(readonly, nonatomic) BOOL dismissed;
+@end
+
class ManagePasswordsControllerTest : public CocoaProfileTest {
public:
+ using VectorConstFormPtr = std::vector<const autofill::PasswordForm*>;
+
ManagePasswordsControllerTest();
~ManagePasswordsControllerTest() override;
void SetUp() override;
ManagePasswordsUIControllerMock* ui_controller() { return ui_controller_; }
+ ContentViewDelegateMock* delegate() { return delegate_.get(); }
ManagePasswordsBubbleModel* GetModelAndCreateIfNull();
// Sets the appropriate state for ManagePasswordsBubbleModel.
void SetUpSavePendingState(bool empty_username);
void SetUpUpdatePendingState(bool multiple_forms);
void SetUpConfirmationState();
- void SetUpManageState();
+ void SetUpManageState(const VectorConstFormPtr& forms);
// An opportunity for tests to override the constructor parameter of
// ManagePasswordsBubbleModel.
@@ -40,12 +50,9 @@ class ManagePasswordsControllerTest : public CocoaProfileTest {
ManagePasswordsUIControllerMock* ui_controller_;
std::unique_ptr<content::WebContents> test_web_contents_;
std::unique_ptr<ManagePasswordsBubbleModel> model_;
-};
+ base::scoped_nsobject<ContentViewDelegateMock> delegate_;
-// Helper delegate for testing the views of the password management bubble.
-@interface ContentViewDelegateMock : NSObject<BasePasswordsContentViewDelegate>
-@property(nonatomic) ManagePasswordsBubbleModel* model;
-@property(readonly, nonatomic) BOOL dismissed;
-@end
+ DISALLOW_COPY_AND_ASSIGN(ManagePasswordsControllerTest);
+};
#endif // CHROME_BROWSER_UI_COCOA_PASSWORDS_BASE_PASSWORDS_CONTROLLER_TEST_H_

Powered by Google App Engine
This is Rietveld 408576698