diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-15 23:52:45 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-15 23:52:45 +0000 |
commit | 84b57956feca7dc25c01c5b5004f6e7eba99bdcc (patch) | |
tree | 013be8da7bbfc600cfde22cb03c11439278fd473 /base/tracked_objects_unittest.cc | |
parent | ea8bc98be00e84fc16c30e0fbc440fe9c283c56c (diff) | |
download | chromium_src-84b57956feca7dc25c01c5b5004f6e7eba99bdcc.zip chromium_src-84b57956feca7dc25c01c5b5004f6e7eba99bdcc.tar.gz chromium_src-84b57956feca7dc25c01c5b5004f6e7eba99bdcc.tar.bz2 |
Update task tracking to not depend on message_loop_ singleton
I also did a bunch of cleanup, and transitioned to tracking
the duration of a run, rather than the time from posting
(construction of a task) to completion of the run. It is
less interesting for now to track queueing delay, and we
need a focus on task execution time. I left in the hook
(API) with the expectation that I'll be extending the
tracked_objects code to include this as well.
I also landed changes to run in Linux/Mac. The fact that
I've punted on shutdown made this landing easy (all
code support was previously lost during migration to
some flavor of bind support).
r=willchan,jam,viettrungluu,ajwong
BUG=62728
Review URL: http://codereview.chromium.org/8233037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105694 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/tracked_objects_unittest.cc')
-rw-r--r-- | base/tracked_objects_unittest.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/base/tracked_objects_unittest.cc b/base/tracked_objects_unittest.cc index e10659d4..c9ab9682 100644 --- a/base/tracked_objects_unittest.cc +++ b/base/tracked_objects_unittest.cc @@ -23,11 +23,11 @@ TEST_F(TrackedObjectsTest, MinimalStartupShutdown) { return; EXPECT_FALSE(ThreadData::first()); // No activity even on this thread. - ThreadData* data = ThreadData::current(); + ThreadData* data = ThreadData::Get(); EXPECT_TRUE(ThreadData::first()); // Now class was constructed. EXPECT_TRUE(data); EXPECT_TRUE(!data->next()); - EXPECT_EQ(data, ThreadData::current()); + EXPECT_EQ(data, ThreadData::Get()); ThreadData::BirthMap birth_map; data->SnapshotBirthMap(&birth_map); EXPECT_EQ(0u, birth_map.size()); @@ -39,11 +39,11 @@ TEST_F(TrackedObjectsTest, MinimalStartupShutdown) { // 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::Get(); EXPECT_TRUE(ThreadData::first()); // Now class was constructed. EXPECT_TRUE(data); EXPECT_TRUE(!data->next()); - EXPECT_EQ(data, ThreadData::current()); + EXPECT_EQ(data, ThreadData::Get()); birth_map.clear(); data->SnapshotBirthMap(&birth_map); EXPECT_EQ(0u, birth_map.size()); @@ -64,7 +64,7 @@ TEST_F(TrackedObjectsTest, TinyStartupShutdown) { const ThreadData* data = ThreadData::first(); ASSERT_TRUE(data); EXPECT_TRUE(!data->next()); - EXPECT_EQ(data, ThreadData::current()); + EXPECT_EQ(data, ThreadData::Get()); ThreadData::BirthMap birth_map; data->SnapshotBirthMap(&birth_map); EXPECT_EQ(1u, birth_map.size()); // 1 birth location. @@ -78,7 +78,9 @@ TEST_F(TrackedObjectsTest, TinyStartupShutdown) { 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 delayed_start_time. */ + base::TimeTicks::TimeTicks() /* Bogus start_run_time. */); birth_map.clear(); data->SnapshotBirthMap(&birth_map); |