OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 i_source->set_resource(NULL); | 388 i_source->set_resource(NULL); |
389 | 389 |
390 // Must not crash. | 390 // Must not crash. |
391 i::Isolate::Current()->logger()->LogCompiledFunctions(); | 391 i::Isolate::Current()->logger()->LogCompiledFunctions(); |
392 } | 392 } |
393 | 393 |
394 | 394 |
395 static void ObjMethod1(const v8::FunctionCallbackInfo<v8::Value>& args) { | 395 static void ObjMethod1(const v8::FunctionCallbackInfo<v8::Value>& args) { |
396 } | 396 } |
397 | 397 |
| 398 |
398 TEST(LogCallbacks) { | 399 TEST(LogCallbacks) { |
399 ScopedLoggerInitializer initialize_logger(false); | 400 ScopedLoggerInitializer initialize_logger(false); |
400 Logger* logger = initialize_logger.logger(); | 401 Logger* logger = initialize_logger.logger(); |
401 | 402 |
402 v8::Local<v8::FunctionTemplate> obj = | 403 v8::Local<v8::FunctionTemplate> obj = |
403 v8::Local<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), | 404 v8::Local<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), |
404 v8::FunctionTemplate::New()); | 405 v8::FunctionTemplate::New()); |
405 obj->SetClassName(v8_str("Obj")); | 406 obj->SetClassName(v8_str("Obj")); |
406 v8::Handle<v8::ObjectTemplate> proto = obj->PrototypeTemplate(); | 407 v8::Handle<v8::ObjectTemplate> proto = obj->PrototypeTemplate(); |
407 v8::Local<v8::Signature> signature = v8::Signature::New(obj); | 408 v8::Local<v8::Signature> signature = v8::Signature::New(obj); |
(...skipping 28 matching lines...) Expand all Loading... |
436 | 437 |
437 static void Prop1Setter(v8::Local<v8::String> property, | 438 static void Prop1Setter(v8::Local<v8::String> property, |
438 v8::Local<v8::Value> value, | 439 v8::Local<v8::Value> value, |
439 const v8::PropertyCallbackInfo<void>& info) { | 440 const v8::PropertyCallbackInfo<void>& info) { |
440 } | 441 } |
441 | 442 |
442 static void Prop2Getter(v8::Local<v8::String> property, | 443 static void Prop2Getter(v8::Local<v8::String> property, |
443 const v8::PropertyCallbackInfo<v8::Value>& info) { | 444 const v8::PropertyCallbackInfo<v8::Value>& info) { |
444 } | 445 } |
445 | 446 |
| 447 |
446 TEST(LogAccessorCallbacks) { | 448 TEST(LogAccessorCallbacks) { |
447 ScopedLoggerInitializer initialize_logger(false); | 449 ScopedLoggerInitializer initialize_logger(false); |
448 Logger* logger = initialize_logger.logger(); | 450 Logger* logger = initialize_logger.logger(); |
449 | 451 |
450 v8::Local<v8::FunctionTemplate> obj = | 452 v8::Local<v8::FunctionTemplate> obj = |
451 v8::Local<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), | 453 v8::Local<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), |
452 v8::FunctionTemplate::New()); | 454 v8::FunctionTemplate::New()); |
453 obj->SetClassName(v8_str("Obj")); | 455 obj->SetClassName(v8_str("Obj")); |
454 v8::Handle<v8::ObjectTemplate> inst = obj->InstanceTemplate(); | 456 v8::Handle<v8::ObjectTemplate> inst = obj->InstanceTemplate(); |
455 inst->SetAccessor(v8_str("prop1"), Prop1Getter, Prop1Setter); | 457 inst->SetAccessor(v8_str("prop1"), Prop1Getter, Prop1Setter); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 v8::Local<v8::String> s = result->ToString(); | 560 v8::Local<v8::String> s = result->ToString(); |
559 i::ScopedVector<char> data(s->Utf8Length() + 1); | 561 i::ScopedVector<char> data(s->Utf8Length() + 1); |
560 CHECK_NE(NULL, data.start()); | 562 CHECK_NE(NULL, data.start()); |
561 s->WriteUtf8(data.start()); | 563 s->WriteUtf8(data.start()); |
562 printf("%s\n", data.start()); | 564 printf("%s\n", data.start()); |
563 // Make sure that our output is written prior crash due to CHECK failure. | 565 // Make sure that our output is written prior crash due to CHECK failure. |
564 fflush(stdout); | 566 fflush(stdout); |
565 CHECK(false); | 567 CHECK(false); |
566 } | 568 } |
567 } | 569 } |
OLD | NEW |