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

Unified Diff: chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc

Issue 8698016: Remove InfoBarDelegate::InfoBarClosed(), delete InfoBars directly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cancelling changes. Created 9 years, 1 month 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
Index: chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
index af78c290b7b31f5f40251a10bca7ac33bec65189..a66bbdbd806364feabc1438c314eb7619817fffe 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
@@ -231,7 +231,7 @@ TEST_F(GeolocationPermissionContextTests, SinglePermission) {
infobar_tab_helper()->RemoveInfoBar(infobar_0);
EXPECT_EQ(1U, closed_delegate_tracker_.size());
EXPECT_TRUE(closed_delegate_tracker_.Contains(infobar_0));
- infobar_0->InfoBarClosed();
+ delete infobar_0;
}
TEST_F(GeolocationPermissionContextTests, QueuedPermission) {
@@ -274,7 +274,7 @@ TEST_F(GeolocationPermissionContextTests, QueuedPermission) {
EXPECT_EQ(1U, closed_delegate_tracker_.size());
EXPECT_TRUE(closed_delegate_tracker_.Contains(infobar_0));
closed_delegate_tracker_.Clear();
- infobar_0->InfoBarClosed();
+ delete infobar_0;
// Now we should have a new infobar for the second frame.
ASSERT_EQ(1U, infobar_tab_helper()->infobar_count());
@@ -291,7 +291,7 @@ TEST_F(GeolocationPermissionContextTests, QueuedPermission) {
infobar_tab_helper()->RemoveInfoBar(infobar_1);
EXPECT_EQ(1U, closed_delegate_tracker_.size());
EXPECT_TRUE(closed_delegate_tracker_.Contains(infobar_1));
- infobar_1->InfoBarClosed();
+ delete infobar_1;
EXPECT_EQ(0U, infobar_tab_helper()->infobar_count());
// Ensure the persisted permissions are ok.
EXPECT_EQ(CONTENT_SETTING_ALLOW,
@@ -348,7 +348,7 @@ TEST_F(GeolocationPermissionContextTests, CancelGeolocationPermissionRequest) {
EXPECT_EQ(1U, closed_delegate_tracker_.size());
EXPECT_TRUE(closed_delegate_tracker_.Contains(infobar_0));
closed_delegate_tracker_.Clear();
- infobar_0->InfoBarClosed();
+ delete infobar_0;
ASSERT_EQ(1U, infobar_tab_helper()->infobar_count());
ConfirmInfoBarDelegate* infobar_1 = infobar_tab_helper()->
@@ -364,7 +364,7 @@ TEST_F(GeolocationPermissionContextTests, CancelGeolocationPermissionRequest) {
infobar_tab_helper()->RemoveInfoBar(infobar_1);
EXPECT_EQ(1U, closed_delegate_tracker_.size());
EXPECT_TRUE(closed_delegate_tracker_.Contains(infobar_1));
- infobar_1->InfoBarClosed();
+ delete infobar_1;
EXPECT_EQ(0U, infobar_tab_helper()->infobar_count());
// Ensure the persisted permissions are ok.
EXPECT_EQ(CONTENT_SETTING_ASK,
@@ -425,14 +425,14 @@ TEST_F(GeolocationPermissionContextTests, SameOriginMultipleTabs) {
infobar_tab_helper()->RemoveInfoBar(infobar_0);
EXPECT_EQ(2U, closed_delegate_tracker_.size());
EXPECT_TRUE(closed_delegate_tracker_.Contains(infobar_0));
- infobar_0->InfoBarClosed();
+ delete infobar_0;
// Now the infobar for the tab with the same origin should have gone.
EXPECT_EQ(0U, extra_tabs_[1]->infobar_tab_helper()->infobar_count());
CheckPermissionMessageSentForTab(1, bridge_id(), true);
EXPECT_TRUE(closed_delegate_tracker_.Contains(removed_infobar));
closed_delegate_tracker_.Clear();
// Destroy the infobar that has just been removed.
- removed_infobar->InfoBarClosed();
+ delete removed_infobar;
// But the other tab should still have the info bar...
ASSERT_EQ(1U, extra_tabs_[0]->infobar_tab_helper()->infobar_count());
@@ -442,7 +442,7 @@ TEST_F(GeolocationPermissionContextTests, SameOriginMultipleTabs) {
extra_tabs_[0]->infobar_tab_helper()->RemoveInfoBar(infobar_1);
EXPECT_EQ(1U, closed_delegate_tracker_.size());
EXPECT_TRUE(closed_delegate_tracker_.Contains(infobar_1));
- infobar_1->InfoBarClosed();
+ delete infobar_1;
extra_tabs_.reset();
}
@@ -478,14 +478,14 @@ TEST_F(GeolocationPermissionContextTests, QueuedOriginMultipleTabs) {
extra_tabs_[0]->infobar_tab_helper()->RemoveInfoBar(infobar_0);
EXPECT_EQ(2U, closed_delegate_tracker_.size());
EXPECT_TRUE(closed_delegate_tracker_.Contains(infobar_0));
- infobar_0->InfoBarClosed();
+ delete infobar_0;
// Now the infobar for the tab with the same origin should have gone.
EXPECT_EQ(0U, infobar_tab_helper()->infobar_count());
CheckPermissionMessageSent(bridge_id(), true);
EXPECT_TRUE(closed_delegate_tracker_.Contains(removed_infobar));
closed_delegate_tracker_.Clear();
// Destroy the infobar that has just been removed.
- removed_infobar->InfoBarClosed();
+ delete removed_infobar;
// And we should have the queued infobar displayed now.
ASSERT_EQ(1U, extra_tabs_[0]->infobar_tab_helper()->infobar_count());
@@ -499,7 +499,7 @@ TEST_F(GeolocationPermissionContextTests, QueuedOriginMultipleTabs) {
extra_tabs_[0]->infobar_tab_helper()->RemoveInfoBar(infobar_1);
EXPECT_EQ(1U, closed_delegate_tracker_.size());
EXPECT_TRUE(closed_delegate_tracker_.Contains(infobar_1));
- infobar_1->InfoBarClosed();
+ delete infobar_1;
extra_tabs_.reset();
}
@@ -538,5 +538,5 @@ TEST_F(GeolocationPermissionContextTests, TabDestroyed) {
// Delete the tab contents.
DeleteContents();
- infobar_0->InfoBarClosed();
+ delete infobar_0;
}
« no previous file with comments | « chrome/browser/download/download_request_infobar_delegate_unittest.cc ('k') | chrome/browser/infobars/infobar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698