Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index c5c932b7516cc70738ad918a9311dabe1e985427..05484fec871d05c015db50cb8c650841dfcf7ba2 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -22116,3 +22116,27 @@ TEST(TestFunctionCallOptimization) { |
ApiCallOptimizationChecker checker; |
checker.RunAll(); |
} |
+ |
+ |
+static const char* last_event_message; |
+static int last_event_status; |
+void StoringEventLoggerCallback(const char* message, int status) { |
+ last_event_message = message; |
+ last_event_status = status; |
+} |
+ |
+ |
+TEST(EventLogging) { |
+ v8::Isolate* isolate = CcTest::isolate(); |
+ isolate->SetEventLogger(StoringEventLoggerCallback); |
+ v8::internal::HistogramTimer* histogramTimer = |
+ new v8::internal::HistogramTimer( |
+ "V8.Test", 0, 10000, 50, |
+ reinterpret_cast<v8::internal::Isolate*>(isolate)); |
+ histogramTimer->Start(); |
+ CHECK_EQ("V8.Test", last_event_message); |
+ CHECK_EQ(0, last_event_status); |
+ histogramTimer->Stop(); |
+ CHECK_EQ("V8.Test", last_event_message); |
+ CHECK_EQ(1, last_event_status); |
+} |