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

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

Issue 186163002: Add support for allowing an embedder to get the V8 profile timer event logs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove check for an existing event_logger, as at this point, none might have already been set Created 6 years, 9 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 | « src/log.cc ('k') | 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 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 22098 matching lines...) Expand 10 before | Expand all | Expand 10 after
22109 Local<Object> ApiCallOptimizationChecker::holder; 22109 Local<Object> ApiCallOptimizationChecker::holder;
22110 Local<Object> ApiCallOptimizationChecker::callee; 22110 Local<Object> ApiCallOptimizationChecker::callee;
22111 int ApiCallOptimizationChecker::count = 0; 22111 int ApiCallOptimizationChecker::count = 0;
22112 22112
22113 22113
22114 TEST(TestFunctionCallOptimization) { 22114 TEST(TestFunctionCallOptimization) {
22115 i::FLAG_allow_natives_syntax = true; 22115 i::FLAG_allow_natives_syntax = true;
22116 ApiCallOptimizationChecker checker; 22116 ApiCallOptimizationChecker checker;
22117 checker.RunAll(); 22117 checker.RunAll();
22118 } 22118 }
22119
22120
22121 static const char* last_event_message;
22122 static int last_event_status;
22123 void StoringEventLoggerCallback(const char* message, int status) {
22124 last_event_message = message;
22125 last_event_status = status;
22126 }
22127
22128
22129 TEST(EventLogging) {
22130 v8::Isolate* isolate = CcTest::isolate();
22131 isolate->SetEventLogger(StoringEventLoggerCallback);
22132 v8::internal::HistogramTimer* histogramTimer =
22133 new v8::internal::HistogramTimer(
22134 "V8.Test", 0, 10000, 50,
22135 reinterpret_cast<v8::internal::Isolate*>(isolate));
22136 histogramTimer->Start();
22137 CHECK_EQ("V8.Test", last_event_message);
22138 CHECK_EQ(0, last_event_status);
22139 histogramTimer->Stop();
22140 CHECK_EQ("V8.Test", last_event_message);
22141 CHECK_EQ(1, last_event_status);
22142 }
OLDNEW
« no previous file with comments | « src/log.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698