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

Unified Diff: chrome/browser/extensions/activity_log/hashed_ad_network_database_unittest.cc

Issue 277133002: Revert of Resubmit: Add real file for AdNetworks DB (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/extensions/activity_log/hashed_ad_network_database_unittest.cc
diff --git a/chrome/browser/extensions/activity_log/hashed_ad_network_database_unittest.cc b/chrome/browser/extensions/activity_log/hashed_ad_network_database_unittest.cc
index 89ba10dfa5215c7b73418247aa566b0eaa3de364..f1e2d776538f71f6f4e5732f67c78d5a888cd4fe 100644
--- a/chrome/browser/extensions/activity_log/hashed_ad_network_database_unittest.cc
+++ b/chrome/browser/extensions/activity_log/hashed_ad_network_database_unittest.cc
@@ -49,7 +49,6 @@
class HashedAdNetworkDatabaseUnitTest : public testing::Test {
protected:
virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
private:
// Generate a piece of memory with a hash structure identical to the real one,
@@ -67,11 +66,6 @@
GenerateMockMemory();
AdNetworkDatabase::SetForTesting(
scoped_ptr<AdNetworkDatabase>(new HashedAdNetworkDatabase(memory_)));
-}
-
-void HashedAdNetworkDatabaseUnitTest::TearDown() {
- // Reset the database.
- AdNetworkDatabase::SetForTesting(scoped_ptr<AdNetworkDatabase>());
}
void HashedAdNetworkDatabaseUnitTest::GenerateMockMemory() {
@@ -100,9 +94,6 @@
memory_ = new base::RefCountedStaticMemory(raw_data_, kDataResourceSize);
};
-// Test that the logic for the Ad Network Database works. That is, the hashing
-// scheme works, correctly reports when URLs are present in the database,
-// treats hosts and sumdomains correctly, etc.
TEST_F(HashedAdNetworkDatabaseUnitTest, HashedAdNetworkDatabaseTest) {
const AdNetworkDatabase* database = AdNetworkDatabase::Get();
ASSERT_TRUE(database);
@@ -139,23 +130,4 @@
GURL("chrome-extension://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")));
}
-// Test that the HashAdNetworkDatabse test works with the real file. For
-// security and privacy purposes, we cannot verify that real URLs are
-// recognized. However, we can at least verify that the file is recognized and
-// parsed.
-TEST(HashedAdNetworkDatabaseWithRealFileUnitTest,
- HashedAdNetworkDatabaseRealFileTest) {
- // This constructs the database, and, since we didn't mock up any memory, it
- // uses the real file.
- const AdNetworkDatabase* database = AdNetworkDatabase::Get();
- ASSERT_TRUE(database);
- const HashedAdNetworkDatabase* hashed_database =
- static_cast<const HashedAdNetworkDatabase*>(database);
- EXPECT_TRUE(hashed_database->is_valid());
-
- // We can also safely assume that a made-up url is not in the database.
- EXPECT_FALSE(database->IsAdNetwork(
- GURL("http://www.this-is-definitely-not-a-real-site.orarealtld")));
-}
-
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/activity_log/hashed_ad_network_database.cc ('k') | chrome/browser/resources/ad_networks.dat » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698