Chromium Code Reviews| Index: test/heap-unittests/heap-unittest.h |
| diff --git a/test/heap-unittests/heap-unittest.h b/test/heap-unittests/heap-unittest.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ff6f569f1e0050485b8743adff06848d4233c659 |
| --- /dev/null |
| +++ b/test/heap-unittests/heap-unittest.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright 2014 the V8 project authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef V8_HEAP_UNITTESTS_HEAP_UNITTEST_H_ |
| +#define V8_HEAP_UNITTESTS_HEAP_UNITTEST_H_ |
| + |
| +#include "src/heap/gc-idle-time-handler.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +namespace v8 { |
| +namespace internal { |
| + |
| +class GCIdleTimeHandlerTest : public ::testing::Test { |
| + public: |
| + GCIdleTimeHandlerTest() {} |
| + virtual ~GCIdleTimeHandlerTest() {} |
| + |
| + GCIdleTimeHandler* handler() { return &handler_; } |
| + |
| + GCIdleTimeHandler::HeapState initial_heap_state() { |
|
Hannes Payer (out of office)
2014/08/22 11:06:30
Can we make a method InitializeHeapState that take
|
| + GCIdleTimeHandler::HeapState result; |
| + result.contexts_disposed = 0; |
| + result.size_of_objects = kSizeOfObjects; |
| + result.incremental_marking_stopped = false; |
| + result.can_start_incremental_marking = true; |
| + result.mark_compact_speed_in_bytes_per_ms = kMarkCompactSpeed; |
| + result.incremental_marking_speed_in_bytes_per_ms = kMarkingSpeed; |
| + return result; |
| + } |
| + |
| + static const size_t kSizeOfObjects = 100 * MB; |
| + static const size_t kMarkCompactSpeed = 100 * KB; |
| + static const size_t kMarkingSpeed = 100 * KB; |
| + |
| + private: |
| + GCIdleTimeHandler handler_; |
| +}; |
| +} |
| +} |
| +#endif // V8_HEAP_UNITTESTS_HEAP_UNITTEST_H_ |