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

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

Issue 1937: Enabling a few tests when using snapshots.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 3 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 | « no previous file | test/mjsunit/debug-script.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
===================================================================
--- test/cctest/test-api.cc (revision 268)
+++ test/cctest/test-api.cc (working copy)
@@ -4697,7 +4697,7 @@
}
-static void EnsureNoSurvivingGlobalObjects() {
+static int GetSurvivingGlobalObjectsCount() {
int count = 0;
v8::internal::Heap::CollectAllGarbage();
v8::internal::HeapIterator it;
@@ -4710,38 +4710,34 @@
#ifdef DEBUG
if (count > 0) v8::internal::Heap::TracePathToGlobal();
#endif
- CHECK_EQ(0, count);
+ return count;
}
-// This test assumes that there are zero global objects when the
-// test starts. This is not going to be true if we are using the
-// API fuzzer.
TEST(DontLeakGlobalObjects) {
// Regression test for issues 1139850 and 1174891.
- v8::internal::V8::Initialize(NULL);
- if (v8::internal::Snapshot::IsEnabled()) return;
+ v8::V8::Initialize();
- EnsureNoSurvivingGlobalObjects();
+ int count = GetSurvivingGlobalObjectsCount();
for (int i = 0; i < 5; i++) {
{ v8::HandleScope scope;
LocalContext context;
}
- EnsureNoSurvivingGlobalObjects();
+ CHECK_EQ(count, GetSurvivingGlobalObjectsCount());
{ v8::HandleScope scope;
LocalContext context;
v8_compile("Date")->Run();
}
- EnsureNoSurvivingGlobalObjects();
+ CHECK_EQ(count, GetSurvivingGlobalObjectsCount());
{ v8::HandleScope scope;
LocalContext context;
v8_compile("/aaa/")->Run();
}
- EnsureNoSurvivingGlobalObjects();
+ CHECK_EQ(count, GetSurvivingGlobalObjectsCount());
{ v8::HandleScope scope;
const char* extension_list[] = { "v8/gc" };
@@ -4749,7 +4745,7 @@
LocalContext context(&extensions);
v8_compile("gc();")->Run();
}
- EnsureNoSurvivingGlobalObjects();
+ CHECK_EQ(count, GetSurvivingGlobalObjectsCount());
{ v8::HandleScope scope;
const char* extension_list[] = { "v8/print" };
@@ -4757,14 +4753,13 @@
LocalContext context(&extensions);
v8_compile("print('hest');")->Run();
}
- EnsureNoSurvivingGlobalObjects();
+ CHECK_EQ(count, GetSurvivingGlobalObjectsCount());
}
}
THREADED_TEST(CheckForCrossContextObjectLiterals) {
- v8::internal::V8::Initialize(NULL);
- if (v8::internal::Snapshot::IsEnabled()) return;
+ v8::V8::Initialize();
const int nof = 2;
const char* sources[nof] = {
« no previous file with comments | « no previous file | test/mjsunit/debug-script.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698