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

Unified Diff: base/tracked_objects_unittest.cc

Issue 8233037: Update task tracking to not depend on message_loop_ singleton (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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: base/tracked_objects_unittest.cc
===================================================================
--- base/tracked_objects_unittest.cc (revision 104925)
+++ base/tracked_objects_unittest.cc (working copy)
@@ -23,11 +23,11 @@
return;
EXPECT_FALSE(ThreadData::first()); // No activity even on this thread.
- ThreadData* data = ThreadData::current();
+ ThreadData* data = ThreadData::FactoryGet(NULL);
EXPECT_TRUE(ThreadData::first()); // Now class was constructed.
EXPECT_TRUE(data);
EXPECT_TRUE(!data->next());
- EXPECT_EQ(data, ThreadData::current());
+ EXPECT_EQ(data, ThreadData::FactoryGet(NULL));
ThreadData::BirthMap birth_map;
data->SnapshotBirthMap(&birth_map);
EXPECT_EQ(0u, birth_map.size());
@@ -39,11 +39,11 @@
// Do it again, just to be sure we reset state completely.
ThreadData::StartTracking(true);
EXPECT_FALSE(ThreadData::first()); // No activity even on this thread.
- data = ThreadData::current();
+ data = ThreadData::FactoryGet(NULL);
EXPECT_TRUE(ThreadData::first()); // Now class was constructed.
EXPECT_TRUE(data);
EXPECT_TRUE(!data->next());
- EXPECT_EQ(data, ThreadData::current());
+ EXPECT_EQ(data, ThreadData::FactoryGet(NULL));
birth_map.clear();
data->SnapshotBirthMap(&birth_map);
EXPECT_EQ(0u, birth_map.size());
@@ -64,7 +64,7 @@
const ThreadData* data = ThreadData::first();
ASSERT_TRUE(data);
EXPECT_TRUE(!data->next());
- EXPECT_EQ(data, ThreadData::current());
+ EXPECT_EQ(data, ThreadData::FactoryGet(NULL));
ThreadData::BirthMap birth_map;
data->SnapshotBirthMap(&birth_map);
EXPECT_EQ(1u, birth_map.size()); // 1 birth location.
@@ -78,7 +78,9 @@
const Births* second_birth = ThreadData::TallyABirthIfActive(location);
ThreadData::TallyADeathIfActive(
second_birth,
- base::TimeDelta::FromSeconds(1) /* Bogus duration. */);
+ base::TimeTicks::TimeTicks(), /* Bogus post_time. */
+ base::TimeTicks::TimeTicks(), /* Bogus start_run_time. */
+ NULL);
birth_map.clear();
data->SnapshotBirthMap(&birth_map);

Powered by Google App Engine
This is Rietveld 408576698