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

Unified Diff: chrome/browser/privacy_blacklist/blacklist_manager_browsertest.cc

Issue 361003: Fix BlacklistManagerBrowserTest.Basic to be more solid. (Closed)
Patch Set: Created 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/privacy_blacklist/blacklist_manager_browsertest.cc
diff --git a/chrome/browser/privacy_blacklist/blacklist_manager_browsertest.cc b/chrome/browser/privacy_blacklist/blacklist_manager_browsertest.cc
index bbc30c452a757704a3d6ca0acf85a05694d24db4..d7a71e9cbe43ac2bdaa1a450063da20900c37422 100644
--- a/chrome/browser/privacy_blacklist/blacklist_manager_browsertest.cc
+++ b/chrome/browser/privacy_blacklist/blacklist_manager_browsertest.cc
@@ -69,24 +69,32 @@ class BlacklistManagerBrowserTest : public ExtensionBrowserTest {
};
IN_PROC_BROWSER_TEST_F(BlacklistManagerBrowserTest, Basic) {
+ static const char kTestUrl[] = "http://host/annoying_ads/ad.jpg";
+
InitializeBlacklistManager();
ASSERT_TRUE(blacklist_manager_->GetCompiledBlacklist());
EXPECT_FALSE(BlacklistHasMatch(blacklist_manager_->GetCompiledBlacklist(),
- "http://host/annoying_ads/ad.jpg"));
+ kTestUrl));
// Test loading an extension with blacklist.
ASSERT_TRUE(LoadExtension(
test_data_dir_.AppendASCII("common").AppendASCII("privacy_blacklist")));
- WaitForBlacklistUpdate();
+ if (!BlacklistHasMatch(blacklist_manager_->GetCompiledBlacklist(),
+ kTestUrl)) {
+ WaitForBlacklistUpdate();
+ }
EXPECT_TRUE(BlacklistHasMatch(blacklist_manager_->GetCompiledBlacklist(),
- "http://host/annoying_ads/ad.jpg"));
+ kTestUrl));
// Make sure that after unloading the extension we update the blacklist.
ExtensionsService* extensions_service =
browser()->profile()->GetExtensionsService();
ASSERT_EQ(1U, extensions_service->extensions()->size());
UnloadExtension(extensions_service->extensions()->front()->id());
- WaitForBlacklistUpdate();
+ if (BlacklistHasMatch(blacklist_manager_->GetCompiledBlacklist(),
+ kTestUrl)) {
+ WaitForBlacklistUpdate();
+ }
EXPECT_FALSE(BlacklistHasMatch(blacklist_manager_->GetCompiledBlacklist(),
- "http://host/annoying_ads/ad.jpg"));
+ kTestUrl));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698