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

Unified Diff: base/tracked_objects_unittest.cc

Issue 7879006: Delete Tracked, and move Location to its own file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 years, 3 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 | « base/tracked_objects.h ('k') | chrome/browser/mac/keystone_glue.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/tracked_objects_unittest.cc
diff --git a/base/tracked_objects_unittest.cc b/base/tracked_objects_unittest.cc
index e7d07a7bc80961dafb0782c776d9817dcc16fc47..e10659d40fb2ac983bc0f67624aaf4db504d4070 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);
« no previous file with comments | « base/tracked_objects.h ('k') | chrome/browser/mac/keystone_glue.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698