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

Unified Diff: chrome/browser/policy/policy_browsertest.cc

Issue 14241006: Eliminate InfoBarTabHelper. Make InfoBarService a concrete class. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 8 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/plugins/plugin_infobar_delegates.cc ('k') | chrome/browser/ssl/ssl_tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/policy_browsertest.cc
===================================================================
--- chrome/browser/policy/policy_browsertest.cc (revision 195254)
+++ chrome/browser/policy/policy_browsertest.cc (working copy)
@@ -1102,15 +1102,14 @@
ASSERT_TRUE(contents);
InfoBarService* infobar_service = InfoBarService::FromWebContents(contents);
ASSERT_TRUE(infobar_service);
- EXPECT_EQ(0u, infobar_service->GetInfoBarCount());
+ EXPECT_EQ(0u, infobar_service->infobar_count());
base::FilePath path(FILE_PATH_LITERAL("plugin/quicktime.html"));
GURL url(URLRequestMockHTTPJob::GetMockUrl(path));
ui_test_utils::NavigateToURL(browser(), url);
// This should have triggered the dangerous plugin infobar.
- ASSERT_EQ(1u, infobar_service->GetInfoBarCount());
- InfoBarDelegate* infobar_delegate =
- infobar_service->GetInfoBarDelegateAt(0);
+ ASSERT_EQ(1u, infobar_service->infobar_count());
+ InfoBarDelegate* infobar_delegate = infobar_service->infobar_at(0);
EXPECT_TRUE(infobar_delegate->AsConfirmInfoBarDelegate());
// And the plugin isn't running.
EXPECT_EQ(0, CountPlugins());
@@ -1122,7 +1121,7 @@
UpdateProviderPolicy(policies);
// Reloading the page shouldn't trigger the infobar this time.
ui_test_utils::NavigateToURL(browser(), url);
- EXPECT_EQ(0u, infobar_service->GetInfoBarCount());
+ EXPECT_EQ(0u, infobar_service->infobar_count());
// And the plugin started automatically.
EXPECT_EQ(1, CountPlugins());
}
@@ -1519,7 +1518,7 @@
ASSERT_TRUE(contents);
InfoBarService* infobar_service = InfoBarService::FromWebContents(contents);
ASSERT_TRUE(infobar_service);
- EXPECT_EQ(0u, infobar_service->GetInfoBarCount());
+ EXPECT_EQ(0u, infobar_service->infobar_count());
// Force enable the translate feature.
PolicyMap policies;
@@ -1539,9 +1538,8 @@
ui_test_utils::NavigateToURL(browser(), url);
language_observer1.Wait();
// Verify that the translate infobar showed up.
- ASSERT_EQ(1u, infobar_service->GetInfoBarCount());
- InfoBarDelegate* infobar_delegate =
- infobar_service->GetInfoBarDelegateAt(0);
+ ASSERT_EQ(1u, infobar_service->infobar_count());
+ InfoBarDelegate* infobar_delegate = infobar_service->infobar_at(0);
TranslateInfoBarDelegate* delegate =
infobar_delegate->AsTranslateInfoBarDelegate();
ASSERT_TRUE(delegate);
@@ -1551,7 +1549,7 @@
// Now force disable translate.
infobar_service->RemoveInfoBar(infobar_delegate);
- EXPECT_EQ(0u, infobar_service->GetInfoBarCount());
+ EXPECT_EQ(0u, infobar_service->infobar_count());
policies.Set(key::kTranslateEnabled, POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER, base::Value::CreateBooleanValue(false));
UpdateProviderPolicy(policies);
@@ -1561,7 +1559,7 @@
content::NotificationService::AllSources());
ui_test_utils::NavigateToURL(browser(), url);
language_observer2.Wait();
- EXPECT_EQ(0u, infobar_service->GetInfoBarCount());
+ EXPECT_EQ(0u, infobar_service->infobar_count());
}
IN_PROC_BROWSER_TEST_F(PolicyTest, URLBlacklist) {
« no previous file with comments | « chrome/browser/plugins/plugin_infobar_delegates.cc ('k') | chrome/browser/ssl/ssl_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698