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

Unified Diff: chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_pending_view_controller_unittest.mm

Issue 1022843003: New smart passsword bubble algorithm. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: handle 'Never' correctly Created 5 years, 9 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/manage_passwords_bubble_pending_view_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_pending_view_controller_unittest.mm b/chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_pending_view_controller_unittest.mm
index 3671cf26d5e11755636c1fb33a0b2297ae27a851..6410d48467e9b03a94b23b8fa0fbc3c079371106 100644
--- a/chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_pending_view_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_pending_view_controller_unittest.mm
@@ -52,7 +52,7 @@ void ClickMenuItem(BubbleCombobox* button, int index) {
class ManagePasswordsBubblePendingViewControllerTest
: public ManagePasswordsControllerTest {
public:
- ManagePasswordsBubblePendingViewControllerTest() : controller_(nil) {}
+ ManagePasswordsBubblePendingViewControllerTest() : combobox_model_(false) {}
void SetUp() override {
ManagePasswordsControllerTest::SetUp();
@@ -74,9 +74,18 @@ class ManagePasswordsBubblePendingViewControllerTest
return controller_.get();
}
+ int index_nope() const {
+ return combobox_model_.index_nope();
+ }
+
+ int index_never() const {
+ return combobox_model_.index_never();
+ }
+
private:
base::scoped_nsobject<ManagePasswordsBubblePendingViewController> controller_;
base::scoped_nsobject<ManagePasswordsBubblePendingViewTestDelegate> delegate_;
+ SavePasswordRefusalComboboxModel combobox_model_;
};
TEST_F(ManagePasswordsBubblePendingViewControllerTest,
@@ -91,7 +100,7 @@ TEST_F(ManagePasswordsBubblePendingViewControllerTest,
TEST_F(ManagePasswordsBubblePendingViewControllerTest,
ShouldNopeAndDismissWhenNopeClicked) {
BubbleCombobox* nopeButton = [controller() nopeButton];
- ClickMenuItem(nopeButton, SavePasswordRefusalComboboxModel::INDEX_NOPE);
+ ClickMenuItem(nopeButton, index_nope());
EXPECT_TRUE([delegate() dismissed]);
EXPECT_FALSE(ui_controller()->saved_password());
@@ -101,8 +110,7 @@ TEST_F(ManagePasswordsBubblePendingViewControllerTest,
TEST_F(ManagePasswordsBubblePendingViewControllerTest,
ShouldNeverSaveAndDismissWhenNeverSaveClickedWithoutAnyBestMatches) {
BubbleCombobox* nopeButton = [controller() nopeButton];
- ClickMenuItem(nopeButton,
- SavePasswordRefusalComboboxModel::INDEX_NEVER_FOR_THIS_SITE);
+ ClickMenuItem(nopeButton, index_never());
EXPECT_TRUE([delegate() dismissed]);
EXPECT_FALSE(ui_controller()->saved_password());
@@ -121,8 +129,7 @@ TEST_F(ManagePasswordsBubblePendingViewControllerTest,
EXPECT_FALSE(model()->local_credentials().empty());
BubbleCombobox* nopeButton = [controller() nopeButton];
- ClickMenuItem(nopeButton,
- SavePasswordRefusalComboboxModel::INDEX_NEVER_FOR_THIS_SITE);
+ ClickMenuItem(nopeButton, index_never());
EXPECT_TRUE([delegate() neverSave]);
EXPECT_FALSE(ui_controller()->saved_password());

Powered by Google App Engine
This is Rietveld 408576698