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

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

Issue 1164643005: Oilpan: Add ENABLE_LAZY_SWEEPING and ENABLE_IDLE_GC to features.gypi (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
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 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after
1821 Persistent<SimpleFinalizedObject> finalized = SimpleFinalizedObject::cre ate(); 1821 Persistent<SimpleFinalizedObject> finalized = SimpleFinalizedObject::cre ate();
1822 EXPECT_EQ(0, SimpleFinalizedObject::s_destructorCalls); 1822 EXPECT_EQ(0, SimpleFinalizedObject::s_destructorCalls);
1823 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GC WithSweep, Heap::ForcedGC); 1823 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GC WithSweep, Heap::ForcedGC);
1824 EXPECT_EQ(0, SimpleFinalizedObject::s_destructorCalls); 1824 EXPECT_EQ(0, SimpleFinalizedObject::s_destructorCalls);
1825 } 1825 }
1826 1826
1827 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GCWith Sweep, Heap::ForcedGC); 1827 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GCWith Sweep, Heap::ForcedGC);
1828 EXPECT_EQ(1, SimpleFinalizedObject::s_destructorCalls); 1828 EXPECT_EQ(1, SimpleFinalizedObject::s_destructorCalls);
1829 } 1829 }
1830 1830
1831 #if ENABLE_LAZY_SWEEPING 1831 #if ENABLE(LAZY_SWEEPING)
1832 TEST(HeapTest, LazySweepingPages) 1832 TEST(HeapTest, LazySweepingPages)
1833 { 1833 {
1834 clearOutOldGarbage(); 1834 clearOutOldGarbage();
1835 1835
1836 SimpleFinalizedObject::s_destructorCalls = 0; 1836 SimpleFinalizedObject::s_destructorCalls = 0;
1837 EXPECT_EQ(0, SimpleFinalizedObject::s_destructorCalls); 1837 EXPECT_EQ(0, SimpleFinalizedObject::s_destructorCalls);
1838 for (int i = 0; i < 1000; i++) 1838 for (int i = 0; i < 1000; i++)
1839 SimpleFinalizedObject::create(); 1839 SimpleFinalizedObject::create();
1840 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GCWith outSweep, Heap::ForcedGC); 1840 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GCWith outSweep, Heap::ForcedGC);
1841 EXPECT_EQ(0, SimpleFinalizedObject::s_destructorCalls); 1841 EXPECT_EQ(0, SimpleFinalizedObject::s_destructorCalls);
(...skipping 4268 matching lines...) Expand 10 before | Expand all | Expand 10 after
6110 { 6110 {
6111 Persistent<ClassWithMember> object = ClassWithMember::create(); 6111 Persistent<ClassWithMember> object = ClassWithMember::create();
6112 EXPECT_EQ(0, object->traceCount()); 6112 EXPECT_EQ(0, object->traceCount());
6113 TestMixinAllocatingObject* mixin = TestMixinAllocatingObject::create(object. get()); 6113 TestMixinAllocatingObject* mixin = TestMixinAllocatingObject::create(object. get());
6114 EXPECT_TRUE(mixin); 6114 EXPECT_TRUE(mixin);
6115 EXPECT_GT(object->traceCount(), 0); 6115 EXPECT_GT(object->traceCount(), 0);
6116 EXPECT_GT(mixin->traceCount(), 0); 6116 EXPECT_GT(mixin->traceCount(), 0);
6117 } 6117 }
6118 6118
6119 } // namespace blink 6119 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698