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

Unified Diff: test/cctest/heap-tester.h

Issue 1293283003: [heap,cctest] Get rid of protected-for-sake-of-testing scope. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add heap-tester.h to cctest.gyp Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/cctest.gyp ('k') | test/cctest/test-alloc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap-tester.h
diff --git a/test/cctest/heap-tester.h b/test/cctest/heap-tester.h
new file mode 100644
index 0000000000000000000000000000000000000000..fc2e25439321287292f7107bdf6f206ec0be9842
--- /dev/null
+++ b/test/cctest/heap-tester.h
@@ -0,0 +1,59 @@
+// Copyright 2015 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 HEAP_TESTER_H_
+#define HEAP_TESTER_H_
+
+#include "src/handles.h"
+#include "src/heap/spaces.h"
+
+// Tests that should have access to private methods of {v8::internal::Heap}.
+// Those tests need to be defined using HEAP_TEST(Name) { ... }.
+#define HEAP_TEST_METHODS(V) \
+ V(GCFlags) \
+ V(MarkCompactCollector) \
+ V(NoPromotion) \
+ V(NumberStringCacheSize) \
+ V(ObjectGroups) \
+ V(Promotion) \
+ V(Regression39128) \
+ V(ResetWeakHandle) \
+ V(StressHandles) \
+ V(TestSizeOfObjects) \
+ V(WriteBarriersInCopyJSObject)
+
+
+#define HEAP_TEST(Name) \
+ CcTest register_test_##Name(v8::internal::HeapTester::Test##Name, __FILE__, \
+ #Name, NULL, true, true); \
+ void v8::internal::HeapTester::Test##Name()
+
+
+#define THREADED_HEAP_TEST(Name) \
+ RegisterThreadedTest register_##Name(v8::internal::HeapTester::Test##Name, \
+ #Name); \
+ /* */ HEAP_TEST(Name)
+
+
+namespace v8 {
+namespace internal {
+
+class HeapTester {
+ public:
+#define DECLARE_STATIC(Name) static void Test##Name();
+
+ HEAP_TEST_METHODS(DECLARE_STATIC)
+#undef HEAP_TEST_METHODS
+
+ /* test-alloc.cc */
+ static AllocationResult AllocateAfterFailures();
+ static Handle<Object> TestAllocateAfterFailures();
+
+ /* test-api.cc */
+ static void ResetWeakHandle(bool global_gc);
+};
+}
+}
+
+#endif // HEAP_TESTER_H_
« no previous file with comments | « test/cctest/cctest.gyp ('k') | test/cctest/test-alloc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698