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

Unified Diff: chrome/browser/autofill/autofill_browsertest.cc

Issue 211273007: Split InfoBarService core code into InfoBarManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + comments Created 6 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
« no previous file with comments | « chrome/browser/android/tab_android.cc ('k') | chrome/browser/autofill/autofill_interactive_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_browsertest.cc
diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc
index 723b652eb65ef4459c2510e1e264c07e1d1b7d8a..0eb543ed0f0ba7b2a7edf8ab3c65840d124163ca 100644
--- a/chrome/browser/autofill/autofill_browsertest.cc
+++ b/chrome/browser/autofill/autofill_browsertest.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
+#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -70,8 +71,11 @@ class WindowedPersonalDataManagerObserver
}
virtual ~WindowedPersonalDataManagerObserver() {
- if (infobar_service_ && (infobar_service_->infobar_count() > 0))
- infobar_service_->RemoveInfoBar(infobar_service_->infobar_at(0));
+ if (infobar_service_ &&
+ (infobar_service_->infobar_manager()->infobar_count() > 0)) {
+ InfoBarManager* infobar_manager = infobar_service_->infobar_manager();
+ infobar_manager->RemoveInfoBar(infobar_manager->infobar_at(0));
+ }
}
void Wait() {
@@ -103,8 +107,9 @@ class WindowedPersonalDataManagerObserver
EXPECT_EQ(chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, type);
infobar_service_ = InfoBarService::FromWebContents(
browser_->tab_strip_model()->GetActiveWebContents());
+ InfoBarManager* infobar_manager = infobar_service_->infobar_manager();
ConfirmInfoBarDelegate* infobar_delegate =
- infobar_service_->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
+ infobar_manager->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate);
infobar_delegate->Accept();
}
@@ -488,10 +493,9 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, InvalidCreditCardNumberIsNotAggregated) {
std::string card("4408 0412 3456 7890");
ASSERT_FALSE(autofill::IsValidCreditCardNumber(ASCIIToUTF16(card)));
SubmitCreditCard("Bob Smith", card.c_str(), "12", "2014");
- ASSERT_EQ(0u,
- InfoBarService::FromWebContents(
- browser()->tab_strip_model()->GetActiveWebContents())->
- infobar_count());
+ InfoBarService* infobar_service = InfoBarService::FromWebContents(
+ browser()->tab_strip_model()->GetActiveWebContents());
+ ASSERT_EQ(0u, infobar_service->infobar_manager()->infobar_count());
}
// Test whitespaces and separator chars are stripped for valid CC numbers.
@@ -675,10 +679,9 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, CCInfoNotStoredWhenAutocompleteOff) {
data["CREDIT_CARD_EXP_4_DIGIT_YEAR"] = "2014";
FillFormAndSubmit("cc_autocomplete_off_test.html", data);
- ASSERT_EQ(0u,
- InfoBarService::FromWebContents(
- browser()->tab_strip_model()->GetActiveWebContents())->
- infobar_count());
+ InfoBarService* infobar_service = InfoBarService::FromWebContents(
+ browser()->tab_strip_model()->GetActiveWebContents());
+ ASSERT_EQ(0u, infobar_service->infobar_manager()->infobar_count());
}
// Test profile not aggregated if email found in non-email field.
« no previous file with comments | « chrome/browser/android/tab_android.cc ('k') | chrome/browser/autofill/autofill_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698