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

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

Issue 11748012: Minor cleanup to how infobars handle expiry: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 12 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
Index: chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
===================================================================
--- chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc (revision 174909)
+++ chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc (working copy)
@@ -670,14 +670,13 @@
ASSERT_EQ(1U, infobar_service()->GetInfoBarCount());
InfoBarDelegate* infobar_0 = infobar_service()->GetInfoBarDelegateAt(0);
ASSERT_TRUE(infobar_0);
- // Ensure the infobar is not yet expired.
+ // Ensure the infobar wouldn't expire for a navigation to the committed entry.
content::LoadCommittedDetails details;
details.entry = web_contents()->GetController().GetLastCommittedEntry();
- ASSERT_FALSE(infobar_0->ShouldExpire(details));
- // Commit the "GoBack()" above, and ensure the infobar is now expired.
- content::WebContentsTester::For(web_contents())->CommitPendingNavigation();
- details.entry = web_contents()->GetController().GetLastCommittedEntry();
- ASSERT_TRUE(infobar_0->ShouldExpire(details));
+ EXPECT_FALSE(infobar_0->ShouldExpire(details));
+ // Ensure the infobar will expire when we commit the pending navigation.
+ details.entry = web_contents()->GetController().GetActiveEntry();
+ EXPECT_TRUE(infobar_0->ShouldExpire(details));
// Delete the tab contents.
DeleteContents();

Powered by Google App Engine
This is Rietveld 408576698