OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 19251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19262 // Reset the failed access check callback so it does not influence | 19262 // Reset the failed access check callback so it does not influence |
19263 // the other tests. | 19263 // the other tests. |
19264 v8::V8::SetFailedAccessCheckCallbackFunction(NULL); | 19264 v8::V8::SetFailedAccessCheckCallbackFunction(NULL); |
19265 } | 19265 } |
19266 | 19266 |
19267 | 19267 |
19268 TEST(IsolateNewDispose) { | 19268 TEST(IsolateNewDispose) { |
19269 v8::Isolate* current_isolate = CcTest::isolate(); | 19269 v8::Isolate* current_isolate = CcTest::isolate(); |
19270 v8::Isolate* isolate = v8::Isolate::New(); | 19270 v8::Isolate* isolate = v8::Isolate::New(); |
19271 CHECK(isolate != NULL); | 19271 CHECK(isolate != NULL); |
| 19272 CHECK(!reinterpret_cast<i::Isolate*>(isolate)->IsDefaultIsolate()); |
19272 CHECK(current_isolate != isolate); | 19273 CHECK(current_isolate != isolate); |
19273 CHECK(current_isolate == CcTest::isolate()); | 19274 CHECK(current_isolate == CcTest::isolate()); |
19274 | 19275 |
19275 v8::V8::SetFatalErrorHandler(StoringErrorCallback); | 19276 v8::V8::SetFatalErrorHandler(StoringErrorCallback); |
19276 last_location = last_message = NULL; | 19277 last_location = last_message = NULL; |
19277 isolate->Dispose(); | 19278 isolate->Dispose(); |
19278 CHECK_EQ(last_location, NULL); | 19279 CHECK_EQ(last_location, NULL); |
19279 CHECK_EQ(last_message, NULL); | 19280 CHECK_EQ(last_message, NULL); |
19280 } | 19281 } |
19281 | 19282 |
(...skipping 3049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22331 CHECK_EQ("V8.Test", last_event_message); | 22332 CHECK_EQ("V8.Test", last_event_message); |
22332 CHECK_EQ(0, last_event_status); | 22333 CHECK_EQ(0, last_event_status); |
22333 histogramTimer->Stop(); | 22334 histogramTimer->Stop(); |
22334 CHECK_EQ("V8.Test", last_event_message); | 22335 CHECK_EQ("V8.Test", last_event_message); |
22335 CHECK_EQ(1, last_event_status); | 22336 CHECK_EQ(1, last_event_status); |
22336 } | 22337 } |
22337 | 22338 |
22338 | 22339 |
22339 TEST(Promises) { | 22340 TEST(Promises) { |
22340 i::FLAG_harmony_promises = true; | 22341 i::FLAG_harmony_promises = true; |
22341 i::FLAG_harmony_weak_collections = true; // Implied | |
22342 | 22342 |
22343 LocalContext context; | 22343 LocalContext context; |
22344 v8::Isolate* isolate = context->GetIsolate(); | 22344 v8::Isolate* isolate = context->GetIsolate(); |
22345 v8::HandleScope scope(isolate); | 22345 v8::HandleScope scope(isolate); |
22346 Handle<Object> global = context->Global(); | 22346 Handle<Object> global = context->Global(); |
22347 | 22347 |
22348 // Creation. | 22348 // Creation. |
22349 Handle<v8::Promise::Resolver> pr = v8::Promise::Resolver::New(isolate); | 22349 Handle<v8::Promise::Resolver> pr = v8::Promise::Resolver::New(isolate); |
22350 Handle<v8::Promise::Resolver> rr = v8::Promise::Resolver::New(isolate); | 22350 Handle<v8::Promise::Resolver> rr = v8::Promise::Resolver::New(isolate); |
22351 Handle<v8::Promise> p = pr->GetPromise(); | 22351 Handle<v8::Promise> p = pr->GetPromise(); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22518 v8::internal::FLAG_stack_size = 150; | 22518 v8::internal::FLAG_stack_size = 150; |
22519 LocalContext current; | 22519 LocalContext current; |
22520 v8::Isolate* isolate = current->GetIsolate(); | 22520 v8::Isolate* isolate = current->GetIsolate(); |
22521 v8::HandleScope scope(isolate); | 22521 v8::HandleScope scope(isolate); |
22522 V8::SetCaptureStackTraceForUncaughtExceptions( | 22522 V8::SetCaptureStackTraceForUncaughtExceptions( |
22523 true, 10, v8::StackTrace::kDetailed); | 22523 true, 10, v8::StackTrace::kDetailed); |
22524 v8::TryCatch try_catch; | 22524 v8::TryCatch try_catch; |
22525 CompileRun("(function f(x) { f(x+1); })(0)"); | 22525 CompileRun("(function f(x) { f(x+1); })(0)"); |
22526 CHECK(try_catch.HasCaught()); | 22526 CHECK(try_catch.HasCaught()); |
22527 } | 22527 } |
OLD | NEW |