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

Side by Side Diff: chrome/browser/password_manager/password_manager_browsertest.cc

Issue 228293004: InfoBarService inherits from InfoBarManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: whitespace Created 6 years, 8 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 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 #include <string> 5 #include <string>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram_samples.h" 8 #include "base/metrics/histogram_samples.h"
9 #include "base/metrics/statistics_recorder.h" 9 #include "base/metrics/statistics_recorder.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
11 #include "chrome/browser/infobars/confirm_infobar_delegate.h" 11 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
12 #include "chrome/browser/infobars/infobar.h" 12 #include "chrome/browser/infobars/infobar.h"
13 #include "chrome/browser/infobars/infobar_manager.h"
14 #include "chrome/browser/infobars/infobar_service.h" 13 #include "chrome/browser/infobars/infobar_service.h"
15 #include "chrome/browser/password_manager/password_store_factory.h" 14 #include "chrome/browser/password_manager/password_store_factory.h"
16 #include "chrome/browser/password_manager/test_password_store_service.h" 15 #include "chrome/browser/password_manager/test_password_store_service.h"
17 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
18 #include "chrome/browser/ui/tabs/tab_strip_model.h" 17 #include "chrome/browser/ui/tabs/tab_strip_model.h"
19 #include "chrome/test/base/in_process_browser_test.h" 18 #include "chrome/test/base/in_process_browser_test.h"
20 #include "chrome/test/base/test_switches.h" 19 #include "chrome/test/base/test_switches.h"
21 #include "chrome/test/base/ui_test_utils.h" 20 #include "chrome/test/base/ui_test_utils.h"
22 #include "components/autofill/core/browser/autofill_test_utils.h" 21 #include "components/autofill/core/browser/autofill_test_utils.h"
23 #include "components/password_manager/core/browser/test_password_store.h" 22 #include "components/password_manager/core/browser/test_password_store.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 wait_for_path_ = path; 68 wait_for_path_ = path;
70 } 69 }
71 70
72 // content::NotificationObserver: 71 // content::NotificationObserver:
73 virtual void Observe(int type, 72 virtual void Observe(int type,
74 const content::NotificationSource& source, 73 const content::NotificationSource& source,
75 const content::NotificationDetails& details) OVERRIDE { 74 const content::NotificationDetails& details) OVERRIDE {
76 switch (type) { 75 switch (type) {
77 case chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED: 76 case chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED:
78 if (should_automatically_accept_infobar_) { 77 if (should_automatically_accept_infobar_) {
79 infobar_service_->infobar_manager() 78 infobar_service_->infobar_at(0)
80 ->infobar_at(0)
81 ->delegate() 79 ->delegate()
82 ->AsConfirmInfoBarDelegate() 80 ->AsConfirmInfoBarDelegate()
83 ->Accept(); 81 ->Accept();
Peter Kasting 2014/04/10 00:08:59 Nit: While here: Fix wrapping: infobar_
84 } 82 }
85 infobar_shown_ = true; 83 infobar_shown_ = true;
86 return; 84 return;
87 case chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED: 85 case chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED:
88 infobar_removed_ = true; 86 infobar_removed_ = true;
89 return; 87 return;
90 default: 88 default:
91 NOTREACHED(); 89 NOTREACHED();
92 return; 90 return;
93 } 91 }
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 DontPromptForPasswordFormWithDefaultValue) { 649 DontPromptForPasswordFormWithDefaultValue) {
652 NavigateToFile("/password/password_form_with_default_value.html"); 650 NavigateToFile("/password/password_form_with_default_value.html");
653 651
654 // Don't prompt if we navigate away even if there is a password value since 652 // Don't prompt if we navigate away even if there is a password value since
655 // it's not coming from the user. 653 // it's not coming from the user.
656 NavigationObserver observer(WebContents()); 654 NavigationObserver observer(WebContents());
657 NavigateToFile("/password/done.html"); 655 NavigateToFile("/password/done.html");
658 observer.Wait(); 656 observer.Wait();
659 EXPECT_FALSE(observer.infobar_shown()); 657 EXPECT_FALSE(observer.infobar_shown());
660 } 658 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698