OLD | NEW |
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 public: | 54 public: |
55 int payload; | 55 int payload; |
56 }; | 56 }; |
57 | 57 |
58 DEFINE_GC_TYPE_MARKER(HeapTestSuperClass); | 58 DEFINE_GC_TYPE_MARKER(HeapTestSuperClass); |
59 | 59 |
60 static const size_t classMagic = 0xABCDDBCA; | 60 static const size_t classMagic = 0xABCDDBCA; |
61 | 61 |
62 class HeapTestSubClass : public HeapTestOtherSuperClass, public HeapTestSuperCla
ss { | 62 class HeapTestSubClass : public HeapTestOtherSuperClass, public HeapTestSuperCla
ss { |
63 public: | 63 public: |
| 64 OVERRIDE_NEW(HeapTestSubClass) |
64 HeapTestSubClass() : m_magic(classMagic) { } | 65 HeapTestSubClass() : m_magic(classMagic) { } |
65 | 66 |
66 virtual ~HeapTestSubClass() | 67 virtual ~HeapTestSubClass() |
67 { | 68 { |
68 EXPECT_EQ(classMagic, m_magic); | 69 EXPECT_EQ(classMagic, m_magic); |
69 ++s_destructorCalls; | 70 ++s_destructorCalls; |
70 Heap::collectGarbage(); // Do a nested garbage collection to verify corr
ect finalization order. | 71 Heap::collectGarbage(); // Do a nested garbage collection to verify corr
ect finalization order. |
71 EXPECT_EQ(classMagic, m_magic); // Contents should not be zapped by a ne
sted GC. | 72 EXPECT_EQ(classMagic, m_magic); // Contents should not be zapped by a ne
sted GC. |
72 } | 73 } |
73 | 74 |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 { | 775 { |
775 HeapTester::memberTest(); | 776 HeapTester::memberTest(); |
776 } | 777 } |
777 | 778 |
778 TEST(heap, WeakOnHeap) | 779 TEST(heap, WeakOnHeap) |
779 { | 780 { |
780 HeapTester::weakOnHeapTest(); | 781 HeapTester::weakOnHeapTest(); |
781 } | 782 } |
782 | 783 |
783 } // namespace WebCore | 784 } // namespace WebCore |
OLD | NEW |