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

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

Issue 102163002: Revert 238283 "Infobar system refactor." (Closed) Base URL: svn://svn.chromium.org/chrome/
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"
22 #include "chrome/browser/infobars/infobar_service.h" 21 #include "chrome/browser/infobars/infobar_service.h"
23 #include "chrome/browser/profiles/profile.h" 22 #include "chrome/browser/profiles/profile.h"
24 #include "chrome/browser/ui/browser.h" 23 #include "chrome/browser/ui/browser.h"
25 #include "chrome/browser/ui/browser_window.h" 24 #include "chrome/browser/ui/browser_window.h"
26 #include "chrome/browser/ui/tabs/tab_strip_model.h" 25 #include "chrome/browser/ui/tabs/tab_strip_model.h"
27 #include "chrome/common/render_messages.h" 26 #include "chrome/common/render_messages.h"
28 #include "chrome/test/base/in_process_browser_test.h" 27 #include "chrome/test/base/in_process_browser_test.h"
29 #include "chrome/test/base/test_switches.h" 28 #include "chrome/test/base/test_switches.h"
30 #include "chrome/test/base/ui_test_utils.h" 29 #include "chrome/test/base/ui_test_utils.h"
31 #include "components/autofill/content/browser/autofill_driver_impl.h" 30 #include "components/autofill/content/browser/autofill_driver_impl.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 93 }
95 94
96 // content::NotificationObserver: 95 // content::NotificationObserver:
97 virtual void Observe(int type, 96 virtual void Observe(int type,
98 const content::NotificationSource& source, 97 const content::NotificationSource& source,
99 const content::NotificationDetails& details) OVERRIDE { 98 const content::NotificationDetails& details) OVERRIDE {
100 EXPECT_EQ(chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, type); 99 EXPECT_EQ(chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, type);
101 infobar_service_ = InfoBarService::FromWebContents( 100 infobar_service_ = InfoBarService::FromWebContents(
102 browser_->tab_strip_model()->GetActiveWebContents()); 101 browser_->tab_strip_model()->GetActiveWebContents());
103 ConfirmInfoBarDelegate* infobar_delegate = 102 ConfirmInfoBarDelegate* infobar_delegate =
104 infobar_service_->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate(); 103 infobar_service_->infobar_at(0)->AsConfirmInfoBarDelegate();
105 ASSERT_TRUE(infobar_delegate); 104 ASSERT_TRUE(infobar_delegate);
106 infobar_delegate->Accept(); 105 infobar_delegate->Accept();
107 } 106 }
108 107
109 private: 108 private:
110 bool alerted_; 109 bool alerted_;
111 bool has_run_message_loop_; 110 bool has_run_message_loop_;
112 Browser* browser_; 111 Browser* browser_;
113 content::NotificationRegistrar registrar_; 112 content::NotificationRegistrar registrar_;
114 InfoBarService* infobar_service_; 113 InfoBarService* infobar_service_;
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 IN_PROC_BROWSER_TEST_F(AutofillTest, 719 IN_PROC_BROWSER_TEST_F(AutofillTest,
721 DISABLED_MergeAggregatedDuplicatedProfiles) { 720 DISABLED_MergeAggregatedDuplicatedProfiles) {
722 int num_of_profiles = 721 int num_of_profiles =
723 AggregateProfilesIntoAutofillPrefs("dataset_duplicated_profiles.txt"); 722 AggregateProfilesIntoAutofillPrefs("dataset_duplicated_profiles.txt");
724 723
725 ASSERT_GT(num_of_profiles, 724 ASSERT_GT(num_of_profiles,
726 static_cast<int>(personal_data_manager()->GetProfiles().size())); 725 static_cast<int>(personal_data_manager()->GetProfiles().size()));
727 } 726 }
728 727
729 } // namespace autofill 728 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698