diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-21 18:05:41 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-21 18:05:41 +0000 |
commit | c62dd9d42bd87964a131adc688d0c70f63cc4cac (patch) | |
tree | b57f3bc0843d2acace088498ecb40e0bfc213b6c /base/tracked_objects_unittest.cc | |
parent | b6bb36e2e8c9a09b4fd733bf74b60a6f02a5a7e9 (diff) | |
download | chromium_src-c62dd9d42bd87964a131adc688d0c70f63cc4cac.zip chromium_src-c62dd9d42bd87964a131adc688d0c70f63cc4cac.tar.gz chromium_src-c62dd9d42bd87964a131adc688d0c70f63cc4cac.tar.bz2 |
Delete Tracked, and move Location to its own file.
The Birth/Death tracking of tasks has been moved out-of-band into MessageLoop's PendingTask structure.
Thus, Task no longer needs to inherit from Tracked. Since Task was the only child of Tracked, delete the Tracked class and move Location to its own file.
BUG=none
TEST=builds
Review URL: http://codereview.chromium.org/7879006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102132 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, 6 insertions, 8 deletions
diff --git a/base/tracked_objects_unittest.cc b/base/tracked_objects_unittest.cc index e7d07a7..e10659d4 100644 --- a/base/tracked_objects_unittest.cc +++ b/base/tracked_objects_unittest.cc @@ -7,6 +7,7 @@ #include "base/tracked_objects.h" #include "base/message_loop.h" +#include "base/time.h" #include "testing/gtest/include/gtest/gtest.h" namespace tracked_objects { @@ -52,17 +53,13 @@ TEST_F(TrackedObjectsTest, MinimalStartupShutdown) { ThreadData::ShutdownSingleThreadedCleanup(); } -class NoopTracked : public tracked_objects::Tracked { -}; - TEST_F(TrackedObjectsTest, TinyStartupShutdown) { if (!ThreadData::StartTracking(true)) return; // Instigate tracking on a single tracked object, or our thread. const Location& location = FROM_HERE; - NoopTracked tracked; - tracked.SetBirthPlace(location); + ThreadData::TallyABirthIfActive(location); const ThreadData* data = ThreadData::first(); ASSERT_TRUE(data); @@ -78,9 +75,10 @@ TEST_F(TrackedObjectsTest, TinyStartupShutdown) { // Now instigate a birth, and a death. - NoopTracked* new_tracked = new NoopTracked; - new_tracked->SetBirthPlace(location); - delete new_tracked; + const Births* second_birth = ThreadData::TallyABirthIfActive(location); + ThreadData::TallyADeathIfActive( + second_birth, + base::TimeDelta::FromSeconds(1) /* Bogus duration. */); birth_map.clear(); data->SnapshotBirthMap(&birth_map); |