Chromium Code Reviews| Index: test/cctest/test-api.cc |
| diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
| index b394e950dd45421f4851e14d8dee926032db1df3..126f3622d7b97e64ab20dbaf3878f57621bd195d 100644 |
| --- a/test/cctest/test-api.cc |
| +++ b/test/cctest/test-api.cc |
| @@ -13385,6 +13385,19 @@ TEST(SourceURLInStackTrace) { |
| // Test that idle notification can be handled and eventually returns true. |
| THREADED_TEST(IdleNotification) { |
| + v8::HandleScope scope; |
| + LocalContext env; |
| + CompileRun( |
| + "function foo() {" |
| + " var a = new Array(1000);" |
| + " for (var i = 0; i < 1000; i++) {" |
| + " a[i] = new Array(1000);" |
| + " for (var j = 0; j < 1000; j++) {" |
| + " a[i][j] = {tag1: i, tag2: j};" |
| + " }" |
| + " }" |
| + "};" |
| + "foo();"); |
| bool rv = false; |
| for (int i = 0; i < 100; i++) { |
| rv = v8::V8::IdleNotification(); |
| @@ -13394,6 +13407,30 @@ THREADED_TEST(IdleNotification) { |
| CHECK(rv == true); |
| } |
| +// Test that idle notification can be handled and eventually returns true. |
| +THREADED_TEST(IdleNotificationWithHint) { |
| + v8::HandleScope scope; |
| + LocalContext env; |
| + CompileRun( |
| + "function foo() {" |
| + " var a = new Array(1000);" |
| + " for (var i = 0; i < 1000; i++) {" |
| + " a[i] = new Array(1000);" |
| + " for (var j = 0; j < 1000; j++) {" |
| + " a[i][j] = {tag1: i, tag2: j};" |
| + " }" |
| + " }" |
| + "};" |
| + "foo();"); |
| + bool rv = false; |
| + for (int i = 0; i < 200; i++) { |
| + rv = v8::V8::IdleNotification(10); |
| + if (rv) |
| + break; |
| + } |
|
Erik Corry
2011/11/25 09:21:30
Can we test that the heap is now much smaller?
|
| + CHECK(rv == true); |
| +} |
| + |
| static uint32_t* stack_limit; |