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

Unified Diff: chrome/browser/visitedlink_perftest.cc

Issue 113591: Fix Acid3 Test 48: LINKTEST, Chromium side.... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: Made waiting more bearable. Created 11 years, 6 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/visitedlink_master.cc ('k') | chrome/browser/visitedlink_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/visitedlink_perftest.cc
===================================================================
--- chrome/browser/visitedlink_perftest.cc (revision 19822)
+++ chrome/browser/visitedlink_perftest.cc (working copy)
@@ -30,11 +30,21 @@
return GURL(StringPrintf("%s%d", prefix, i));
}
-// we have no slaves, so this broadcase is a NOP
-VisitedLinkMaster::PostNewTableEvent DummyBroadcastNewTableEvent;
-void DummyBroadcastNewTableEvent(base::SharedMemory *table) {
-}
+// We have no slaves, so all methods on this listener are a no-ops.
+class DummyVisitedLinkEventListener : public VisitedLinkMaster::Listener {
+ public:
+ DummyVisitedLinkEventListener() {}
+ virtual void NewTable(base::SharedMemory* table) {}
+ virtual void Add(VisitedLinkCommon::Fingerprint) {}
+ virtual void Reset() {}
+ static DummyVisitedLinkEventListener* GetInstance() {
+ static DummyVisitedLinkEventListener instance;
+ return &instance;
+ }
+};
+
+
// Call at the beginning of the test to retrieve the database name.
void InitDBName(std::wstring* db_name) {
FilePath db_path;
@@ -80,8 +90,8 @@
// useful to make another set of tests to test these things in isolation.
TEST_F(VisitedLink, TestAddAndQuery) {
// init
- VisitedLinkMaster master(NULL, DummyBroadcastNewTableEvent, NULL, true,
- FilePath(db_name_), 0);
+ VisitedLinkMaster master(NULL, DummyVisitedLinkEventListener::GetInstance(),
+ NULL, true, FilePath(db_name_), 0);
ASSERT_TRUE(master.Init());
PerfTimeLogger timer("Visited_link_add_and_query");
@@ -111,8 +121,8 @@
{
PerfTimeLogger table_initialization_timer("Table_initialization");
- VisitedLinkMaster master(NULL, DummyBroadcastNewTableEvent, NULL, true,
- FilePath(db_name_), 0);
+ VisitedLinkMaster master(NULL, DummyVisitedLinkEventListener::GetInstance(),
+ NULL, true, FilePath(db_name_), 0);
// time init with empty table
PerfTimeLogger initTimer("Empty_visited_link_init");
@@ -151,8 +161,12 @@
{
PerfTimer cold_timer;
- VisitedLinkMaster master(NULL, DummyBroadcastNewTableEvent, NULL, true,
- FilePath(db_name_), 0);
+ VisitedLinkMaster master(NULL,
+ DummyVisitedLinkEventListener::GetInstance(),
+ NULL,
+ true,
+ FilePath(db_name_),
+ 0);
bool success = master.Init();
TimeDelta elapsed = cold_timer.Elapsed();
ASSERT_TRUE(success);
@@ -164,8 +178,12 @@
{
PerfTimer hot_timer;
- VisitedLinkMaster master(NULL, DummyBroadcastNewTableEvent, NULL, true,
- FilePath(db_name_), 0);
+ VisitedLinkMaster master(NULL,
+ DummyVisitedLinkEventListener::GetInstance(),
+ NULL,
+ true,
+ FilePath(db_name_),
+ 0);
bool success = master.Init();
TimeDelta elapsed = hot_timer.Elapsed();
ASSERT_TRUE(success);
« no previous file with comments | « chrome/browser/visitedlink_master.cc ('k') | chrome/browser/visitedlink_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698