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

Side by Side Diff: test/cctest/test-log.cc

Issue 17589010: CPUProfiler: fix for test. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 416
417 logger->LogCompiledFunctions(); 417 logger->LogCompiledFunctions();
418 418
419 bool exists = false; 419 bool exists = false;
420 i::Vector<const char> log( 420 i::Vector<const char> log(
421 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); 421 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true));
422 CHECK(exists); 422 CHECK(exists);
423 423
424 i::EmbeddedVector<char, 100> ref_data; 424 i::EmbeddedVector<char, 100> ref_data;
425 i::OS::SNPrintF(ref_data, 425 i::OS::SNPrintF(ref_data,
426 "code-creation,Callback,-3,0x%" V8PRIxPTR ",1,\"method1\"\0", 426 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"method1\"\0",
427 ObjMethod1); 427 ObjMethod1);
428 428
429 CHECK_NE(NULL, StrNStr(log.start(), ref_data.start(), log.length())); 429 CHECK_NE(NULL, StrNStr(log.start(), ref_data.start(), log.length()));
430 } 430 }
431 431
432 432
433 static void Prop1Getter(v8::Local<v8::String> property, 433 static void Prop1Getter(v8::Local<v8::String> property,
434 const v8::PropertyCallbackInfo<v8::Value>& info) { 434 const v8::PropertyCallbackInfo<v8::Value>& info) {
435 } 435 }
436 436
(...skipping 20 matching lines...) Expand all
457 457
458 logger->LogAccessorCallbacks(); 458 logger->LogAccessorCallbacks();
459 459
460 bool exists = false; 460 bool exists = false;
461 i::Vector<const char> log( 461 i::Vector<const char> log(
462 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); 462 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true));
463 CHECK(exists); 463 CHECK(exists);
464 464
465 EmbeddedVector<char, 100> prop1_getter_record; 465 EmbeddedVector<char, 100> prop1_getter_record;
466 i::OS::SNPrintF(prop1_getter_record, 466 i::OS::SNPrintF(prop1_getter_record,
467 "code-creation,Callback,-3,0x%" V8PRIxPTR ",1,\"get prop1\"", 467 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"get prop1\"",
468 Prop1Getter); 468 Prop1Getter);
469 CHECK_NE(NULL, 469 CHECK_NE(NULL,
470 StrNStr(log.start(), prop1_getter_record.start(), log.length())); 470 StrNStr(log.start(), prop1_getter_record.start(), log.length()));
471 471
472 EmbeddedVector<char, 100> prop1_setter_record; 472 EmbeddedVector<char, 100> prop1_setter_record;
473 i::OS::SNPrintF(prop1_setter_record, 473 i::OS::SNPrintF(prop1_setter_record,
474 "code-creation,Callback,-3,0x%" V8PRIxPTR ",1,\"set prop1\"", 474 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"set prop1\"",
475 Prop1Setter); 475 Prop1Setter);
476 CHECK_NE(NULL, 476 CHECK_NE(NULL,
477 StrNStr(log.start(), prop1_setter_record.start(), log.length())); 477 StrNStr(log.start(), prop1_setter_record.start(), log.length()));
478 478
479 EmbeddedVector<char, 100> prop2_getter_record; 479 EmbeddedVector<char, 100> prop2_getter_record;
480 i::OS::SNPrintF(prop2_getter_record, 480 i::OS::SNPrintF(prop2_getter_record,
481 "code-creation,Callback,-3,0x%" V8PRIxPTR ",1,\"get prop2\"", 481 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"get prop2\"",
482 Prop2Getter); 482 Prop2Getter);
483 CHECK_NE(NULL, 483 CHECK_NE(NULL,
484 StrNStr(log.start(), prop2_getter_record.start(), log.length())); 484 StrNStr(log.start(), prop2_getter_record.start(), log.length()));
485 } 485 }
486 486
487 487
488 TEST(IsLoggingPreserved) { 488 TEST(IsLoggingPreserved) {
489 ScopedLoggerInitializer initialize_logger(false); 489 ScopedLoggerInitializer initialize_logger(false);
490 Logger* logger = initialize_logger.logger(); 490 Logger* logger = initialize_logger.logger();
491 491
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 v8::Local<v8::String> s = result->ToString(); 558 v8::Local<v8::String> s = result->ToString();
559 i::ScopedVector<char> data(s->Utf8Length() + 1); 559 i::ScopedVector<char> data(s->Utf8Length() + 1);
560 CHECK_NE(NULL, data.start()); 560 CHECK_NE(NULL, data.start());
561 s->WriteUtf8(data.start()); 561 s->WriteUtf8(data.start());
562 printf("%s\n", data.start()); 562 printf("%s\n", data.start());
563 // Make sure that our output is written prior crash due to CHECK failure. 563 // Make sure that our output is written prior crash due to CHECK failure.
564 fflush(stdout); 564 fflush(stdout);
565 CHECK(false); 565 CHECK(false);
566 } 566 }
567 } 567 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698