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

Unified Diff: test/cctest/test-alloc.cc

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/heap-tester.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-alloc.cc
diff --git a/test/cctest/test-alloc.cc b/test/cctest/test-alloc.cc
index 74388d1785047b9319a5a521791a3bb14fc98c09..9c442a79c820cb262ffb91e7e03df2bacb9f3361 100644
--- a/test/cctest/test-alloc.cc
+++ b/test/cctest/test-alloc.cc
@@ -30,19 +30,20 @@
#include "src/accessors.h"
#include "src/api.h"
+#include "test/cctest/heap-tester.h"
using namespace v8::internal;
-static AllocationResult AllocateAfterFailures() {
+AllocationResult v8::internal::HeapTester::AllocateAfterFailures() {
static int attempts = 0;
// The first 4 times we simulate a full heap, by returning retry.
if (++attempts < 4) return AllocationResult::Retry();
// Expose some private stuff on Heap.
- TestHeap* heap = CcTest::test_heap();
+ Heap* heap = CcTest::heap();
// Now that we have returned 'retry' 4 times, we are in a last-chance
// scenario, with always_allocate. See CALL_AND_RETRY. Test that all
@@ -97,16 +98,16 @@ static AllocationResult AllocateAfterFailures() {
}
-static Handle<Object> Test() {
+Handle<Object> v8::internal::HeapTester::TestAllocateAfterFailures() {
CALL_HEAP_FUNCTION(CcTest::i_isolate(), AllocateAfterFailures(), Object);
}
-TEST(StressHandles) {
+HEAP_TEST(StressHandles) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::Context> env = v8::Context::New(CcTest::isolate());
env->Enter();
- Handle<Object> o = Test();
+ Handle<Object> o = TestAllocateAfterFailures();
CHECK(o->IsTrue());
env->Exit();
}
@@ -117,7 +118,8 @@ void TestGetter(
const v8::PropertyCallbackInfo<v8::Value>& info) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
HandleScope scope(isolate);
- info.GetReturnValue().Set(v8::Utils::ToLocal(Test()));
+ info.GetReturnValue().Set(v8::Utils::ToLocal(
+ v8::internal::HeapTester::TestAllocateAfterFailures()));
}
« no previous file with comments | « test/cctest/heap-tester.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698