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

Side by Side Diff: Source/platform/heap/HeapTest.cpp

Issue 452723002: Oilpan: blink_heap_unittests: Test case have memory leak checked by Lsan (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: change collectGarbage(...) to collectAllGarbage() in HeapTest main() Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/platform/heap/RunAllTests.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 4957 matching lines...) Expand 10 before | Expand all | Expand 10 after
4968 4968
4969 static volatile IntWrapper* s_workerObjectPointer; 4969 static volatile IntWrapper* s_workerObjectPointer;
4970 }; 4970 };
4971 4971
4972 TEST(HeapTest, RecursiveMutex) 4972 TEST(HeapTest, RecursiveMutex)
4973 { 4973 {
4974 RecursiveLockingTester::test(); 4974 RecursiveLockingTester::test();
4975 } 4975 }
4976 4976
4977 template<typename T> 4977 template<typename T>
4978 class TraceIfNeededTester : public GarbageCollected<TraceIfNeededTester<T> > { 4978 class TraceIfNeededTester : public GarbageCollectedFinalized<TraceIfNeededTester <T> > {
4979 public: 4979 public:
4980 static TraceIfNeededTester<T>* create() { return new TraceIfNeededTester<T>( ); } 4980 static TraceIfNeededTester<T>* create() { return new TraceIfNeededTester<T>( ); }
4981 static TraceIfNeededTester<T>* create(const T& obj) { return new TraceIfNeed edTester<T>(obj); } 4981 static TraceIfNeededTester<T>* create(const T& obj) { return new TraceIfNeed edTester<T>(obj); }
4982 void trace(Visitor* visitor) { TraceIfNeeded<T>::trace(visitor, &m_obj); } 4982 void trace(Visitor* visitor) { TraceIfNeeded<T>::trace(visitor, &m_obj); }
4983 T& obj() { return m_obj; } 4983 T& obj() { return m_obj; }
4984 ~TraceIfNeededTester() { }
4984 private: 4985 private:
4985 TraceIfNeededTester() { } 4986 TraceIfNeededTester() { }
4986 explicit TraceIfNeededTester(const T& obj) : m_obj(obj) { } 4987 explicit TraceIfNeededTester(const T& obj) : m_obj(obj) { }
4987 T m_obj; 4988 T m_obj;
4988 }; 4989 };
4989 4990
4990 class PartObject { 4991 class PartObject {
4991 DISALLOW_ALLOCATION(); 4992 DISALLOW_ALLOCATION();
4992 public: 4993 public:
4993 PartObject() : m_obj(SimpleObject::create()) { } 4994 PartObject() : m_obj(SimpleObject::create()) { }
(...skipping 30 matching lines...) Expand all
5024 { 5025 {
5025 TraceIfNeededTester<HeapVector<Member<SimpleObject> > >* m_vec = TraceIf NeededTester<HeapVector<Member<SimpleObject> > >::create(); 5026 TraceIfNeededTester<HeapVector<Member<SimpleObject> > >* m_vec = TraceIf NeededTester<HeapVector<Member<SimpleObject> > >::create();
5026 m_vec->obj().append(SimpleObject::create()); 5027 m_vec->obj().append(SimpleObject::create());
5027 visitor.reset(); 5028 visitor.reset();
5028 m_vec->trace(&visitor); 5029 m_vec->trace(&visitor);
5029 EXPECT_EQ(2u, visitor.count()); 5030 EXPECT_EQ(2u, visitor.count());
5030 } 5031 }
5031 } 5032 }
5032 5033
5033 } // namespace blink 5034 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/heap/RunAllTests.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698