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

Side by Side Diff: chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc

Issue 399573002: [Password Generation] Trigger confirmation bubble when a password is saved (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win Again Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "base/metrics/histogram_samples.h" 5 #include "base/metrics/histogram_samples.h"
6 #include "base/prefs/pref_service.h" 6 #include "base/prefs/pref_service.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/test/statistics_delta_reader.h" 8 #include "base/test/statistics_delta_reader.h"
9 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" 9 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h"
10 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" 10 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 model_->set_state(password_manager::ui::MANAGE_STATE); 46 model_->set_state(password_manager::ui::MANAGE_STATE);
47 model_->OnBubbleShown(ManagePasswordsBubble::USER_ACTION); 47 model_->OnBubbleShown(ManagePasswordsBubble::USER_ACTION);
48 controller()->SetState(password_manager::ui::MANAGE_STATE); 48 controller()->SetState(password_manager::ui::MANAGE_STATE);
49 } 49 }
50 50
51 void PretendBlacklisted() { 51 void PretendBlacklisted() {
52 model_->set_state(password_manager::ui::BLACKLIST_STATE); 52 model_->set_state(password_manager::ui::BLACKLIST_STATE);
53 model_->OnBubbleShown(ManagePasswordsBubble::USER_ACTION); 53 model_->OnBubbleShown(ManagePasswordsBubble::USER_ACTION);
54 54
55 base::string16 kTestUsername = base::ASCIIToUTF16("test_username"); 55 base::string16 kTestUsername = base::ASCIIToUTF16("test_username");
56 autofill::PasswordFormMap map; 56 autofill::ConstPasswordFormMap map;
57 map[kTestUsername] = &test_form_; 57 map[kTestUsername] = &test_form_;
58 controller()->SetPasswordFormMap(map); 58 controller()->SetPasswordFormMap(map);
59 controller()->SetState(password_manager::ui::BLACKLIST_STATE); 59 controller()->SetState(password_manager::ui::BLACKLIST_STATE);
60 } 60 }
61 61
62 ManagePasswordsUIControllerMock* controller() { 62 ManagePasswordsUIControllerMock* controller() {
63 return static_cast<ManagePasswordsUIControllerMock*>( 63 return static_cast<ManagePasswordsUIControllerMock*>(
64 ManagePasswordsUIController::FromWebContents( 64 ManagePasswordsUIController::FromWebContents(
65 test_web_contents_.get())); 65 test_web_contents_.get()));
66 } 66 }
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 model_->set_state(password_manager::ui::MANAGE_STATE); 309 model_->set_state(password_manager::ui::MANAGE_STATE);
310 EXPECT_FALSE(password_manager::ui::IsPendingState(model_->state())); 310 EXPECT_FALSE(password_manager::ui::IsPendingState(model_->state()));
311 model_->set_state(password_manager::ui::BLACKLIST_STATE); 311 model_->set_state(password_manager::ui::BLACKLIST_STATE);
312 EXPECT_FALSE(password_manager::ui::IsPendingState(model_->state())); 312 EXPECT_FALSE(password_manager::ui::IsPendingState(model_->state()));
313 313
314 model_->set_state(password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE); 314 model_->set_state(password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE);
315 EXPECT_TRUE(password_manager::ui::IsPendingState(model_->state())); 315 EXPECT_TRUE(password_manager::ui::IsPendingState(model_->state()));
316 model_->set_state(password_manager::ui::PENDING_PASSWORD_STATE); 316 model_->set_state(password_manager::ui::PENDING_PASSWORD_STATE);
317 EXPECT_TRUE(password_manager::ui::IsPendingState(model_->state())); 317 EXPECT_TRUE(password_manager::ui::IsPendingState(model_->state()));
318 } 318 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698