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

Side by Side Diff: chrome/browser/autofill/autofill_browsertest.cc

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/rand_util.h" 12 #include "base/rand_util.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/string_split.h" 15 #include "base/strings/string_split.h"
16 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
17 #include "base/time/time.h" 17 #include "base/time/time.h"
18 #include "chrome/browser/autofill/personal_data_manager_factory.h" 18 #include "chrome/browser/autofill/personal_data_manager_factory.h"
19 #include "chrome/browser/chrome_notification_types.h" 19 #include "chrome/browser/chrome_notification_types.h"
20 #include "chrome/browser/infobars/confirm_infobar_delegate.h" 20 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
21 #include "chrome/browser/infobars/infobar.h"
21 #include "chrome/browser/infobars/infobar_service.h" 22 #include "chrome/browser/infobars/infobar_service.h"
22 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
23 #include "chrome/browser/ui/browser.h" 24 #include "chrome/browser/ui/browser.h"
24 #include "chrome/browser/ui/browser_window.h" 25 #include "chrome/browser/ui/browser_window.h"
25 #include "chrome/browser/ui/tabs/tab_strip_model.h" 26 #include "chrome/browser/ui/tabs/tab_strip_model.h"
26 #include "chrome/common/render_messages.h" 27 #include "chrome/common/render_messages.h"
27 #include "chrome/test/base/in_process_browser_test.h" 28 #include "chrome/test/base/in_process_browser_test.h"
28 #include "chrome/test/base/test_switches.h" 29 #include "chrome/test/base/test_switches.h"
29 #include "chrome/test/base/ui_test_utils.h" 30 #include "chrome/test/base/ui_test_utils.h"
30 #include "components/autofill/content/browser/autofill_driver_impl.h" 31 #include "components/autofill/content/browser/autofill_driver_impl.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 94 }
94 95
95 // content::NotificationObserver: 96 // content::NotificationObserver:
96 virtual void Observe(int type, 97 virtual void Observe(int type,
97 const content::NotificationSource& source, 98 const content::NotificationSource& source,
98 const content::NotificationDetails& details) OVERRIDE { 99 const content::NotificationDetails& details) OVERRIDE {
99 EXPECT_EQ(chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, type); 100 EXPECT_EQ(chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, type);
100 infobar_service_ = InfoBarService::FromWebContents( 101 infobar_service_ = InfoBarService::FromWebContents(
101 browser_->tab_strip_model()->GetActiveWebContents()); 102 browser_->tab_strip_model()->GetActiveWebContents());
102 ConfirmInfoBarDelegate* infobar_delegate = 103 ConfirmInfoBarDelegate* infobar_delegate =
103 infobar_service_->infobar_at(0)->AsConfirmInfoBarDelegate(); 104 infobar_service_->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
104 ASSERT_TRUE(infobar_delegate); 105 ASSERT_TRUE(infobar_delegate);
105 infobar_delegate->Accept(); 106 infobar_delegate->Accept();
106 } 107 }
107 108
108 private: 109 private:
109 bool alerted_; 110 bool alerted_;
110 bool has_run_message_loop_; 111 bool has_run_message_loop_;
111 Browser* browser_; 112 Browser* browser_;
112 content::NotificationRegistrar registrar_; 113 content::NotificationRegistrar registrar_;
113 InfoBarService* infobar_service_; 114 InfoBarService* infobar_service_;
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 IN_PROC_BROWSER_TEST_F(AutofillTest, 720 IN_PROC_BROWSER_TEST_F(AutofillTest,
720 DISABLED_MergeAggregatedDuplicatedProfiles) { 721 DISABLED_MergeAggregatedDuplicatedProfiles) {
721 int num_of_profiles = 722 int num_of_profiles =
722 AggregateProfilesIntoAutofillPrefs("dataset_duplicated_profiles.txt"); 723 AggregateProfilesIntoAutofillPrefs("dataset_duplicated_profiles.txt");
723 724
724 ASSERT_GT(num_of_profiles, 725 ASSERT_GT(num_of_profiles,
725 static_cast<int>(personal_data_manager()->GetProfiles().size())); 726 static_cast<int>(personal_data_manager()->GetProfiles().size()));
726 } 727 }
727 728
728 } // namespace autofill 729 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/accessibility/accessibility_extension_api.cc ('k') | chrome/browser/autofill/autofill_cc_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698